From:	AITGW::"kenney@star.enet.dec.com" "Forrest A. Kenney 14-Jan-1992 1516" 14-JAN-1992 15:20:34.55
To:	arisia::everhart
CC:	
Subj:	Some final misc odds and ends

Received: by AITGW.DECnet (utk-mail11 v1.5) ; Tue, 14 Jan 92 15:21:24 EST
Received: from enet-gw.pa.dec.com by aitgw.ge.com (5.65/GE Gateway 1.4)
	id AA23937; Tue, 14 Jan 92 15:21:18 -0500
Received: by enet-gw.pa.dec.com; id AA02684; Tue, 14 Jan 92 12:18:19 -0800
Message-Id: <9201142018.AA02684@enet-gw.pa.dec.com>
Received: from star.enet; by decwrl.enet; Tue, 14 Jan 92 12:18:21 PST
Date: Tue, 14 Jan 92 12:18:21 PST
From: Forrest A. Kenney  14-Jan-1992 1516 <kenney@star.enet.dec.com>
To: arisia::everhart
Apparently-To: everhart@arisia.dnet.ge.com
Subject: Some final misc odds and ends
 
	.TITLE	PT_CREATE, Create a Pseudo Terminal
	.IDENT	'V1.1-001'
;+
; =============================================================================
;
;
;	PT_CREATE	Create a Pseudo Terminal
;
;           Copyright (C) 1985, Digital Equipment Corporation and
;			Titan Systems
;
;	H. F. Clifford    - Digital Software Services -  2-MAY-1985
;
;
;	Version 1.0		VAX-11 MACRO 
;
;	Revisions to version:
;
;	V1.1-001	HFC	16-AUG-85
;	Change name of device to PTY to avoid conflict with multiple DSA
;	controllers on a machine.
;
; =============================================================================
;-
;+
; =============================================================================
;
;	PT_CREATE	Create a Pseudo Terminal
;
;	Description:
;		Create a Pseudo Terminal.
;
;	Calling Sequence:
;		STATUS.wl.v = PT_CREATE( CHAN.ww.r, DEVNAME.wa.r, LEN.wl.r)
;
;	Argument List:
;		CHAN		address of word to write the channel
;				 number of created PT
;		DEVNAME		address of descriptor to hold the created
;				 PT's device name.
;		LEN		address of longword to contain the length of
;				 the PT's device name.
;
;	Completion Status:
;		SS$_BADPARAM	- DEVNAME buffer length is 0.
;		return codes from $ASSIGN and $GETDVI
;
;	Implicit Inputs:
;		NONE
;
;	Implicit Outputs:
;		NONE
;
;	Data structures:
;		NONE
;
;	External references:
;		$ASSIGN		VMS system service to assign a channel
;		$GETDVI		VMS system service to get device information
;
;	Special notes:
;		NONE
;
;	Module Algorithm:
;	   BEGIN
;	   CALL $ASSIGN to assign a channel to the template PT. The assign
;	    causes a new PT to be cloned and a channel to be assigned to the
;	    cloned UCB.
;	   CALL $GETDVI to obtain the device name of the cloned PT.
;	   RETURN
;	   END
;
; =============================================================================
;-

	$SSDEF
	$DVIDEF
 
PT_CHAN		= 4	; argument offsets
PT_DEVNAME	= 8
PT_LEN		= 12
 
	.PSECT $CODE	LONG PIC USR CON REL LCL SHR EXE RD NOWRT NOVEC
 
PT_TEMPLATE:	.ASCID	/PTY0:/			; template device
 
	.ENTRY PT_CREATE,0
;+
;  Assign channel to template PT. This clones the PT and assigns a
;   channel to the cloned PT.
;-
	MOVQ	#0,-(SP)			; two dummy args.
	PUSHL	PT_CHAN(AP)
	PUSHAL	PT_TEMPLATE
 
	CALLS	#4,SYS$ASSIGN			; create new PT by cloning
	BLBC	R0,10$				; if error leave here
;+
;  Now, get the cloned PT's device name.
;-
	MOVL	#SS$_BADPARAM,R0		; assume return buffer len 0
 
						; build $GETDVI item list
	PUSHL	#0				; terminate item list
	PUSHL	PT_LEN(AP)			; push return length address
	MOVL	PT_DEVNAME(AP),R1		; R1 => devname descriptor
	MOVL	4(R1),-(SP)			; push devname address
	MOVW	#DVI$_DEVNAM,-(SP)		; push item code
	MOVW	(R1),-(SP)			; push buffer length
	BEQL	10$				; if no buffer specified then
						;  pretend we did the $GETDVI
	MOVL	SP,R1				; save location of item list
 
	MOVQ	#0,-(SP)			; nullarg and astprm
	MOVQ	#0,-(SP)			; iosb and astadr
	PUSHL	R1				; item list
	PUSHL	#0				; devnam (this is what we want)
	PUSHL	@PT_CHAN(AP)			; channel
	PUSHL	#0				; efn
 
	CALLS	#8,SYS$GETDVIW			; get the device name
10$:
	RET					; back to caller
	.END

!	PT_RBFBITDEF.FOR
!
! =============================================================================
!++
!
!
! PT_RBFBITDEF		Define RBF changed characteristics bits.
!
!           Copyright (C) 1985, Digital Equipment Corporation and
!			Titan Systems
!
!	Forrest A. Kenney - Digital Software Services -  16-AUG-1985
!
!
!	Version 1.1		VAX-11 MACRO 
!
!	Revisions to version:
!		XXX		XX-XXX-XX
!		Describe change 
!
!--
! =============================================================================
!
!
 
	PARAMETER	RBF_M_BASIC_CHAR	= '00000002'X
	PARAMETER	RBF_V_BASIC_CHAR	= '00000001'X
 
	PARAMETER	RBF_M_BROADCAST		= '00000008'X
	PARAMETER	RBF_V_BROADCAST		= '00000003'X
 
	PARAMETER	RBF_M_EXTENDED_CHAR	= '00000004'X
	PARAMETER	RBF_V_EXTENDED_CHAR	= '00000002'X
 
	PARAMETER	RBF_M_HANGUP		= '00000020'X
	PARAMETER	RBF_V_HANGUP		= '00000005'X
 
	PARAMETER	RBF_M_MODEM		= '00000010'X
	PARAMETER	RBF_V_MODEM		= '00000004'X
 
	PARAMETER	RBF_M_NEW_CHAR		= '00000001'X
	PARAMETER	RBF_V_NEW_CHAR		= '00000000'X

!	PT_IODEF.FOR
!
! =============================================================================
!++
!
!
! PT_IODEF 		Define PTDRIVER specific I/O function codes.
!
!           Copyright (C) 1985, Digital Equipment Corporation and
!			Titan Systems
!
!	Forrest A. Kenney - Digital Software Services -  20-MAY-1985
!
!
!	Version 1.1		VAX-11 MACRO 
!
!	Revisions to version:
!		XXX		XX-XXX-XX
!		Describe change 
!
!--
! =============================================================================
!
!
 	PARAMETER	IO$_GETIO	= IO$_REWIND
	PARAMETER	IO$_FINISHIO	= IO$_REWINDOFF
	PARAMETER	IO$_QUEUEAST	= IO$_SKIPFILE
	PARAMETER	IO$_SETATTN	= IO$_SKIPRECORD
