.MCall .Module .Module KEDCM7 RELEASE=V02 VERSION=14 COMMENT=,IDENT=NO,AUDIT=NO,GLOBAL=.KEDC7 ; COPYRIGHT 1989, 1990, 1991 BY ; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. ; ALL RIGHTS RESERVED ; ;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED ;ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE ;INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER ;COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY ;OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY ;TRANSFERRED. ; ;THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE ;AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT ;CORPORATION. ; ;DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS ;SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY DIGITAL. ; ; 014 22-Feb-1997 ARB Missing VT10$0 Conditionals ; .Enable LC .Enable GBL ; ;MODULE: KEDCM7 ; ;ABSTRACT: ; ; This module contains the routines to exit the edit session. ; .SbTtl Definitions ErrByt =: 53 ;User error byte is 53 Succ$ =: 1 ;ERRBYT's value if user exit'S Warn$ =: 2 ;ERRBYT's value if user quit'S .SbTtl Error Macro Definitions ;+ ;ERROR ; .IIf NDF,$KED$, .Page .IIf NDF,$KED$, .SbTtl Errors from KEDCM7 module ; ; Module: KEDCM7 ; ; Define the error macros for this module ; .MCall ErrDef ErrDef C7,ERROR ;- ;+ ;HELPER ; .IIf NDF,$KED$, .Page .IIf NDF,$KED$, .SbTtl Errors from KEDCM7 module ; ; Module: KEDCM7 ; ; Define the help macros for this module ; .MCall HlpDef HlpDef C7 ;- .SbTtl .SbTtl C.EXIT - Exit file ; ; C.EXIT ; ; Write out last of file ; Unless stopped by Ctrl/C ; .Enabl LSB C.Exit:: ;~x~ NoEChk ;~x~Don't give "too many arguments" TstB @R1 ;Is this the end of the line? Bne 70$ ;~x~No, error=invalid command Mov PC,-(SP) ;Remember to delete journal Br 10$ ;~x~ ...... C.ESav:: ;~x~ EndChk ;~x~Validate command line termination SpcExt:: ;~x~ Clr -(SP) ;Remember not to delete the journal 10$: Call C.LSto ;~x~If learning, end it gracefully Mov #Ax$Out,R4 ;Check for active file BitB #Fst$Ac,F$Sts(R4) ;Active? Beq 20$ ;~x~Nope Call $ClsFl ;~x~Close the file 20$: $Print #BotScr ;~x~Go to bottom of screen in case ;No working... SetBsy ;~x~Make sure busy is set RCtrlO ;~x~Reset Ctrl/O Call $SpOff ;~x~ and turn off special input so we ; can type ahead Call SclXit ;~x~Exit from the file Bcc 50$ ;~x~All is ok 30$: Call $SpOn ;~x~Reset special input mode Clr HlpDne ;Make sure this message is used Clr CtrlC ;Make sure we use this message ClrBsy ;~x~Editor not now busy ;.Assume V.Clr EQ 0 Clr R0 ;Mark screen not correct Call VWatch ;~x~Screen manager Call $JoExcl ;~x~Don't include the EXIT in the journal Tst (SP)+ ;Pop journal info 40$: ;~x~ ;+ ;HELPER HELPER ;~x~ ;Exit was stopped by double CTRL/C ;- ;>>move to KEDIO!!! .................... ; If we come here, we are ready to end the work session. Clean up the ; journal and set the system error byte. 50$: BisB #Succ$,@#ErrByt ;~x~Set succ error byte Call 120$ ;~x~End session Tst (SP)+ ;Should we delete journal? Beq 60$ ;~x~No Call $DlJou ;~x~Delete journal if one Bcc 110$ ;~x~Ok, it's deleted. Restart us ;from beginning ;No, couldn't delete, update it 60$: Call SavJou ;~x~Finish journaling Br 110$ ;~x~Restart us from beginning ........... 70$: ;~x~ ;+ ;HELPER HELPER ;~x~ ;Exit or Quit was given with an argument that wasn't "SAVE" ;- ; ;SAVJOU ; ;End the journal file by writing out the last buffer and ending it ;with a ^Z. Do not include the EXIT SAVE or QUIT SAVE command. ; SavJou: IsJou ;~x~Are we journaling? Beq 80$ ;~x~No, skip clean up Mov #Jo$Out,R4 ;Point to the journal file descriptor MovB #,R0 ;Put in the ^Z Call $PutCh ;~x~ Call $ClsFl ;~x~Do final write and close the file JouOff 80$: Return ;~x~ .SbTtl C.QUIT - Immediate abort of editor ; ; C.QUIT -- immediate abort of editor ; C.Quit:: ;~x~ NoEChk ;~x~Don't give "too many arguments" TstB @R1 ;Is this the end of the line? Bne 70$ ;~x~No, error=invalid command SpcQut:: ;~x~ Call $DlJou ;~x~Delete journal file if any Bcc 100$ ;~x~Journal was deleted Br 90$ ;~x~Couldn't delete it; let's update it ............ C.QSav:: ;~x~ EndChk ;~x~Validate command line termination 90$: Call SavJou ;~x~Finish up journaling 100$: Call C.LSto ;~x~If learning, end it gracefully Call 120$ ;~x~Finish up Call $Purge ;~x~Purge all files ;>>>MOVE to KEDIO!!! ;*JMP* RT specific? > BisB #Warn$,@#ErrByt ;Set warning in userrbyte to say quit Tst Inspct ;Inspect mode? Beq 140$ ;~x~Br if not BitB #Fst$Ac,Ax$Out+F$Sts ;Else check for aux output file Bne 140$ ;~x~Print message if there is one 110$: .if NE,VT10$0 ; ;014 $Print #ARpOn ;~x~force autorepeat on .Endc ;VT10$0 ; ;014 Jmp Restr ;~x~Restart the editor .............. 120$: ClrBsy ;~x~We are no longer busy .if NE,VT10$0 ; ;014 $Print #ARpOn ;~x~force autorepeat on .Endc ;VT10$0 ; ;014 $Print #AltOff ;~x~Alt keypad off $Print #BotScr ;~x~To the bottom in case working... ;was there Clr EdActv ;Editor not active now 130$: Return ;~x~ ...... 140$: ;~x~ ;+ ;ERROR ERROR ,W ;~x~ ;QUIT purges all output files and gives this message before returning ;to CSI state ;- BR 110$ ;~x~Go restart the editor ........... .Dsabl LSB .End