Google
 

Trailing-Edge - PDP-10 Archives - BB-FP64A-SB_1986 - 10,7/usage/usrent.mac
There are 4 other files named usrent.mac in the archive. Click here to see a list.
TITLE	USRENT - Example of generating a user defined accounting entry

;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

;This example program will generate a USAGE file entry via the QUEUE. UUO.
;	Since the distributed ACTDAE does not contain any pre-defined user
;	entries, modifications will have to be made to ACTRCD.MAC, the entry
;	definition module.  The following lines should be added to ACTRCD.MAC
;	in the ENLIST and RCLIST macros designated as those defining user entries.

;ENLIST	-	ENTRY	(FO1,<UEH,BA1,UID>) ;ENTRY xxxx - SAMPLE
;RCLIST	-	RECORD	(BA1,1,1,<COM>)

;After inserting the above definitions, re-assemble ACTRCD.MAC and link/save
;	ACTDAE.  Because the entries added to ENLIST are assigned a sequential
;	entry number starting at 5000, the entry number of the above definition
;	is not known at this time.  This program will make entry 9999 which is
;	clearly illegal, change the entry number here to the correct one.

;Any program wishing to make a Usage Entry must be privileged or [OPR]

	T1==1			;DEFINE SOME AC'S
	T2==2
	T3==3
	T4==4

	USRVER==1		;VERSION NUMBER
	USREDT==3		;EDIT NUMBER
	USRWHO==0		;WHO LAST EDIT
	USRMIN==0		;MINOR VERSION NUMBER

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


USRENT:	RESET			;START FRESH
	PJOB	T1,		;GET OUT JOB NUMBER
	MOVEM	T1,MONJNO	;STORE IT FOR QUEUE.
	MOVSI	T4,(ASCIZ/D/)	;ASSUME DETACHED
	TRMNO.	T1,		;GET TERMINAL DESIGNATOR
	  JRST	SETTN1		;DETACHED
	DPB	T1,[POINT 9,MONLNO,35] ;STORE IN CASE NO NETWORKS
	GETLCH	T1		;GET LINE CHARACTERISTICS
	MOVSI	T4,(ASCIZ/T/)	;ASSUME REGULAR TTY
	TXNE	T1,GL.CTY	;THE SYSTEM CTY
	MOVSI	T4,(ASCIZ/C/)	;YES
	TXNE	T1,GL.ITY	;INVISIBLE (PSEUDO) TTY
	MOVSI	T4,(ASCIZ/P/)	;YES
	HRRZS	T1		;GET RID OF GETLCH BITS
	GTNTN.	T1,		;CONVERT TO NODE AND LINE
	  JRST	SETTN1		;NO NETWORKS
	HRRZM	T1,MONLNO	;STORE REAL LINE NUMBER
	HLRZ	T3,T1		;ISOLATE NODE NUMBER
	MOVEI	T2,2		;NUMBER OF ARGUMENTS
	MOVE	T1,[.NDRNN,,T2]	;RETURN NODE NAME FOR NUMBER
	NODE.	T1,		;ASK TODD
	  SKIPA			;FAILED?
	MOVEM	T1,MONNOD	;STORE SIXBIT NODE NAME
SETTN1:	MOVEM	T4,MONTDE	;STORE TERMINAL DESIGNATOR
	MOVEI	T1,.GTPPN	;GETTAB PPN
	HRL	T1,MONJNO	;FOR THE DESIRED JOB
	GETTAB	T1,		;GET IT
	  HALT	.		;WHAT!
	MOVEM	T1,MONPPN	;SAVE IT FOR QUEUE.
	MOVEI	T1,.GTNM1	;USERS NAME
	HRL	T1,MONJNO	;FOR THE DESIRED JOB
	GETTAB	T1,		;GET IT
	  HALT	.		;WHAT!
	MOVEM	T1,MONNM1	;SAVE IT
	MOVEI	T1,.GTNM2	;OTHER HALF OF THE NAME
	HRL	T1,MONJNO	;FOR THE DESIRED JOB
	GETTAB	T1,		;GET THAT TOO
	  HALT	.		;WHAT!
	MOVEM	T1,MONNM2	;SAVE OTHER HALF

;Now done with gathering the data, ship it off to the ACTDAE

	MOVE	T1,[BLKLEN,,ACTBLK] ;LENGTH,,ADDRESS OF PARAMETERS
	QUEUE.	T1,		;MAKE AN ENTRY
	  JRST	[OUTSTR [ASCIZ/?/] ;ERROR FROM ACTDAE, PREFIX IT
		 OUTSTR RESBLK	;SHOW ERROR ACTDAE RETURNED
		 JRST XIT]	;AND QUIT
	OUTSTR	[ASCIZ/Done./]	;SAY IT WORKED
XIT:	MONRT.			;ALL DONE
	JRST	.-1		;NO CONTINUE

;Use the macros from ACTSYM to generate a DEFUS list for the supplied data items

ACTBLK:	USENT.	(^D9999,1,1,20,RESBLK) ;ENTRY TYPE = 9999, VERSION NUMBERS
				;AND LENGTH,ADDRESS OF RESPONSE BLOCK.

;The DEFUS list proper.  These do not have to be in any particular order.  They
;	are entered here in the order of the data items described in the record
;	definitions in ACTRCD.

;Record 1 - Entry Header

	USJNO.	(MONJNO)	;THE JOB NUMBER
	USTRM.	(MONTDE)	;TERMINAL DESIGNATOR
	USLNO.	(MONLNO)	;LINE NUMBER
	USPNM.	(<SIXBIT/USRENT/>,US%IMM) ;PROGRAM NAME (IMMEDIATE DATA ITEM)
	USPVR.	(.JBVER##)	;PROGRAM VERSION NUMBER
	USNOD.	(MONNOD)	;NODE NAME

;Record 2 - User Data

	USCOM.	(COMENT)	;39 CHARACTER STRING

;Record 3 - User Identification

	USPPN.	(MONPPN)	;PPN
	USNM1.	(MONNM1)	;NAME (1ST HALF)
	USNM3.	(MONNM2)	;NAME (2ND HALF)

BLKLEN==.-ACTBLK		;LENGTH OF QUEUE. ARGUMENT BLOCK

RESBLK:	BLOCK	20		;ROOM FOR A RESPONSE
MONJNO:	BLOCK	1		;JOB NUMBER
MONTDE:	BLOCK	1		;TERMINAL DESIGNATOR
MONLNO:	BLOCK	1		;LINE NUMBER
MONNOD:	BLOCK	1		;NODE NAME
MONPPN:	BLOCK	1		;PPN
MONNM1:	BLOCK	1		;NAME (1ST HALF)
MONNM2:	BLOCK	1		;NAME (2ND HALF)

COMENT:	ASCIZ/Please put this in the Usage File/

	END	USRENT