Google
 

Trailing-Edge - PDP-10 Archives - tops10_tools_bb-fp64a-sb - 10,7/usage/valid.mac
There are 4 other files named valid.mac in the archive. Click here to see a list.
TITLE	VALID - Example of requesting account validation via the QUEUE. UUO

;COPYRIGHT (C) 1980,1981 BY DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
;
;
;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 WHICH IS NOT SUPPLIED BY DIGITAL.


	SEARCH	UUOSYM,MACTEN,ACTSYM	;GET SOME SYMBOLS
	SALL

T1=1
T2=2
T3=3
T4=4
P=17

	VALVER==1			;VERSION NUMBER
	VALEDT==2			;EDIT NUMBER
	VALWHO==0			;WHO LAST EDIT
	VALMIN==0			;MINOR VERSION NUMBER

	LOC	137
	VRSN.	(VAL)			;INSTALL THE VERSION NUMBER
	RELOC

VALID:	RESET				;START FRESH
	GETPPN	T1,			;GET OUR PPN
	  JFCL				;SILLY SKIP
	MOVEM	T1,PPN			;STORE FOR REQUEST
	MOVE	T1,[.ACTRD,,[2		;FUNCTION READ ACCOUNT STRING
			     -1		;FOR THE CURRENT JOB
			     ACTBLK]]	;PUT IT THERE
	ACCT.	T1,			;ASK FOR IT
	  JRST	[OUTSTR [ASCIZ/?Cannot read jobs account string/]
		JRST XIT]		;GIVE UP
	MOVE	T1,[7,,[QF.RSP!.QUVAL	;NUMBER OF ARGS,,WANT RESPONSE, VALIDATE
			   0		;RESERVED
			   20,,RESPON	;LEN,,ADDR OF RESPONSE BLOCK
			   1,,.QBOID	;PPN TO VALIDATE
			   PPN		;THERE IT IS
			   10,,.QBACT	;ACCOUNT STRING THAT GOES WITH IT
			   ACTBLK]]	;THERE IT IS

;Now we are ready to ask for the validation.  This better work since this
;	job obviously has a valid account string (or there is a bug in LOGIN).
;	An unprivileged user may only ask about his (her) own PPN.

	QUEUE.	T1,			;ASK FOR VALIDATION
	  JRST	[OUTSTR [ASCIZ/?/]	;VALIDATION ERROR, ADD ERROR CHARACTER
		OUTSTR RESPON		;ADD ACTDAE'S ERROR MESSAGE
		JRST XIT]		;AND QUIT
	OUTSTR	[ASCIZ/Validation successful./]
	LDB	T1,[POINT 7,RESPON,6]	;SEE IF ACTDAE RETURNED AN ACCOUNT STRING
	JUMPE	T1,XIT			;NOPE, ALL DONE
	OUTSTR	[ASCIZ/ (Account string returned = "/]
	OUTSTR	RESPON			;SHOW RETURNED ACCOUNT STRING
	OUTSTR	[ASCIZ/")./]		;END MESSAGE
XIT:	MONRT.				;ALL DONE
	JRST	.-1			;NO CONTINUE

ACTBLK:	BLOCK	10
PPN:	BLOCK	1
RESPON:	BLOCK	20

	END	VALID