Google
 

Trailing-Edge - PDP-10 Archives - QT020_T20_4.1_6.1_SWSKIT_851021 - swskit-hacks/gripe.mac
There are 10 other files named gripe.mac in the archive. Click here to see a list.
	TITLE	GRIPE	YET ANOTHER IMPLEMENTATION
	SUBTTL	J. G. ZIMA/JGZ	JULY 1985


	SEARCH	MONSYM,MACSYM	;MONITOR SYMBOLS
	.REQUIRE REL:ARMAIL	;MAIL SENDING ROUTINE
	.REQUIRE REL:ITEXTI	;FANCY TEXTI INPUT ROUTINE
	.REQUIRE REL:MACREL	;MACSYM ROUTINES
	.DIRECTIVE FLBLST	;NICE
	SALL			; LISTING



;VERSION INFORMATION:

	VMAJOR==1		;MAJOR VERSION LEVEL
	VMINOR==0		;MINOR VERSION LEVEL
	VEDIT==^D2		;EDIT LEVEL
	VWHO==0			;WHO LAST EDITED
	VGRIPE=<VWHO>B2+<VMAJOR>B11+<VMINOR>B17+VEDIT



;GRIPE IS A PRODUCT OF THE TOPS-20 MONITOR SUPPORT UNIT OF SOFTWARE SERVICES,
;PRIMARILY FOR INCLUSION ON THE TOPS-20 MONITOR SWSKIT.
;THE PURPOSE OF GRIPE IS TO SEND A MAIL MESSAGE TO A DESIGNATED RECIPIENT
;(GRIPE-LIST:), WHO HANDLES "GRIPES" FOR THE SYSTEM (OR NETWORK REGION).
;ITS INTERFACE IS DESIGNED TO REMOVE THE NEED FOR THE TROUBLED USER TO
;KNOW MUCH BEYOND SAYING "GRIPE".
;
;NOTES:	1) ARMAIL IS NOT UP TO HANDLING NETWORK MAILING ADDRESSES
;	2) AS NORMALLY ASSEMBLED, ARMAIL CALLS THE IPCF MAILER
;
;RELATED FILES:
;	GRIPE.HLP	HELP FILE FOR GRIPE TYPED OUT BY HELP COMMAND
;	GRIPE.MAC	THIS FILE
;	GRIPE.CTL	CONTROL FILE TO BUILD GRIPE
;	ARMAIL.REL	SUPPORT ROUTINES CODE FILE - MAIL SENDING
;	ITEXTI.REL	SUPPORT ROUTINES CODE FILE - FANCY TEXTI INPUT
	SUBTTL	REVISION HISTORY

;REVISION HISTORY:
;
;
;   1	JGZ	8-JUL-85
;		START TYPING.
;
;   2	JGZ	18-JUL-85
;		ADD GRIPE-LIST: TRANSLATION AND DEFAULT IF THERE IS NONE
;		IN DEFLST.
;
	SUBTTL	DEFINITIONS AND MAIN PROGRAM

;ACCUMULATOR DEFINITIONS

	STDAC.			;USE STANDARD ACS


;ENTRY VECTOR

EVEC:	JRST	GRIPE		;START ADDRESS
	JRST	GRIPE		;REENTER ADDRESS
	VGRIPE			;VERSION NUMBER


;MAIN PROGRAM

GRIPE:	RESET			;START FRESH
	MOVE	P,[IOWD	PDLLEN,PDL] ;SETUP STACK

;SEE IF WE CAN BUILD THE TO: LIST FOR THE MESSAGE

	MOVX	T1,.LNSJB	;TRY JOB-WIDE DEFINITION FIRST
	HRROI	T2,[ASCIZ/GRIPE-LIST/] ;THE SYMBOL
	HRROI	T3,TOLIST	;WHERE TO PUT IT
	LNMST			;ANY SUCH?
	 ERJMP	GRIP.1		; NO...
	JRST	GRIP.T		; YES, USE IT
GRIP.1:	MOVX	T1,.LNSSY	;OTHERWISE TRY SYSTEM DEFINITION
	HRROI	T2,[ASCIZ/GRIPE-LIST/] ;THE SYMBOL
	HRROI	T3,TOLIST	;WHERE TO PUT IT
	LNMST			;ANY SUCH?
	 ERJMP	GRIP.2		; NO...
	JRST	GRIP.T		; YES, USE IT
GRIP.2:	HRROI	T2,DEFLST	;LOGICAL NAME FAILED, POINT TO DEFAULT LIST
	HRROI	T1,TOLIST	; AND COPY IT
	SETZ	T3,0		; AS ASCII
	SOUT			; TO THE BUFFER
	 ERJMP	.+1

;...

;GET THE SUBJECT TEXT PART OF THE MESSAGE

GRIP.T:	TMSG	<Subject of this GRIPE: > ;PROMPT FOR IT
	HRROI	T1,SUBJCT	;POINT TO SUBJECT BUFFER
	MOVX	T2,RD%BEL+SBJCNT ;BREAK ON CRLF, 80 CHARS MAX
	HRROI	T3,[ASCIZ/Subject of this GRIPE: /] ;FOR ^R
	RDTTY			;READ SUBJECT
	 ERJMP	RDOOPS		;FAILED...

;NOW READ THE MESSAGE TEXT INTO TXTBUF ALLOWING FOR INCLUDE FILES AND
;EDITING OF THE TEXT.

	TMSG	<
Enter text (ESC or ctrl-Z to send, ctrl-K to redisplay, ctrl-B to
	    insert file, or ctrl-E to enter editor):

>				;PROMPT FOR TEXT FIELD
	HRROI	T1,TXTBUF	;POINT TO TEXT BUFFER
	MOVX	T2,TXTCNT	;SIZE OF IT IN BYTES
	HRROI	T3,[0]		;NULL CONTROL-R/PROMPT STRING
	CALL	ITEXTI##	;DO THE TEXTI
	 JRST	TXOOPS		;FAILED.....


;NOW CALL ARMAIL WITH THE TEXT, T1 HAS ADDRESS OF BLOCK WITH THE POINTERS
;TO TO LIST, SUBJECT TEXT, AND MESSAGE TEXT.  T2 HAS FLAG CONCERNED WITH
;ARCHIVING STUFF THAT WE DON'T CARE ABOUT.

	MOVEI	T1,MAIBLK	;POINT TO MAIL ARGUMENT BLOCK
	MOVEI	T2,.MLNFL##	;JUST USE MAIL.TXT
	CALL	MLTLST##	;CALL ARMAIL ROUTINE TO SEND MAIL

	TMSG	<
Thank you.>			;BE POLITE
	HALTF			;AND DONE
	JRST	GRIPE		;RESTART ON CONTINUE


;HERE ON UNEXPECTED ERRORS

RDOOPS:
TXOOPS:
	PERSTR	<? Oops, Unexpected error:  >
	HALTF			;GIVE UP
	JRST	.-1		; AND STAY OUT
	SUBTTL	DATA STORAGE

	XLIST			;THE LITERALS
GRLITS:	LIT			;DUMP 'EM
	LIST

PDL:	BLOCK	<PDLLEN==200>	;PUSHDOWN STACK
MAIBLK:	POINT 7,TOLIST		;3-WORD BLOCK FOR ARMAIL POINTERS
	POINT 7,SUBJCT		;SUBJECT FIELD
	POINT 7,TXTBUF		;TEXT OF MESSAGE
DEFLST:	ASCIZ/OPERATOR/		;DEFAULT RECEIVER OF COMPLAINTS
TOLIST:	BLOCK	<TOLCNT==200>	;TRANSLATION OF TOLIST LOGICAL NAME
SUBJCT:	BLOCK	<SBJCNT==^D100>/5+1 ;SUBJECT TEXT BUFFER
TXTBUF:	BLOCK	<TXTCNT==100000>/5 ;THE BIG TEXT BUFFER


	END	<3,,EVEC>