

	Integer Function FTP$READ_QIOW( Buffer, Blk_Size,
	1				Byte_Count, Status, Dev_Data )
c
	Byte		Buffer
c
	Integer		Blk_Size
	Integer		Byte_Count,	Status,		Dev_Data
c
	Include 'FTP$FLAGS.FOR'
c
	Include '($IODEF)'
c
	Integer		SYS$QIOW,			QIO_Status
	Integer		Long_Block
c
	Integer*2	Short_Block( 2 ),		IOSB( 4 )
c
	Equivalence	( Short_Block,	Long_Block )
c
	QIO_Status = SYS$QIOW	(				! [efn]
	1			,	%Val( FTP$Channel )	! chan
	1			,	%Val( IO$_READLBLK )	! func
	1			,	IOSB			! [iosb]
	1			,				! [astadr]
	1			,				! [astprm]
	1			,	Buffer			! [p1]
	1			,	%Val( Blk_Size )	! [p2]
	1			,				! [p3]
	1			,				! [p4]
	1			,				! [p5]
	1			,				! [p6]
	1			)
c
	If ( .not. QIO_Status ) Call Lib$Signal( %Val(QIO_Status) )
c
	FTP$READ_QIOW = QIO_Status
c
	If ( %Loc(Status) .ne. 0 ) Then
	    Short_Block( 2 ) = 0
	    Short_Block( 1 ) = IOSB( 1 )
	    Status = Long_Block
	End If
c
	If ( %Loc(Byte_Count) .ne. 0 ) Then
	    Short_Block( 2 ) = 0
	    Short_Block( 1 ) = IOSB( 2 )
	    Byte_Count = Long_Block
	End If
c
	If ( %Loc(Dev_Data) .ne. 0 ) Then
	    Short_Block( 1 ) = IOSB( 3 )
	    Short_Block( 2 ) = IOSB( 4 )
	    Dev_Data = Long_Block
	End If
c
	Return
	End



	Integer Function FTP$WRITE_QIOW( Buffer, Blk_Size,
	1				 Byte_Count, Status, Dev_Data )
c
	Byte		Buffer
c
	Integer		Blk_Size
	Integer		Byte_Count,	Status,		Dev_Data
c
	Include 'FTP$FLAGS.FOR'
c
	Include '($IODEF)'
c
	Integer		SYS$QIOW,			QIO_Status
	Integer		Long_Block
	Integer*2	Short_Block( 2 ),		IOSB( 4 )
c
	Equivalence	( Short_Block,	Long_Block )
c
	QIO_Status = SYS$QIOW	(				! [efn]
	1			,	%Val( FTP$Channel )	! chan
	1			,	%Val( IO$_WRITELBLK )	! func
	1			,	IOSB			! [iosb]
	1			,				! [astadr]
	1			,				! [astprm]
	1			,	Buffer			! [p1]
	1			,	%Val( Blk_Size )	! [p2]
	1			,				! [p3]
	1			,				! [p4]
	1			,				! [p5]
	1			,				! [p6]
	1			)
c
	If ( .not. QIO_Status ) Call Lib$Signal( %Val(QIO_Status) )
c
	FTP$WRITE_QIOW = QIO_Status
c
	If ( %Loc(Status) .ne. 0 ) Then
	    Short_Block( 2 ) = 0
	    Short_Block( 1 ) = IOSB( 1 )
	    Status = Long_Block
	End If
c
	If ( %Loc(Byte_Count) .ne. 0 ) Then
	    Short_Block( 2 ) = 0
	    Short_Block( 1 ) = IOSB( 2 )
	    Byte_Count = Long_Block
	End If
c
	If ( %Loc(Dev_Data) .ne. 0 ) Then
	    Short_Block( 1 ) = IOSB( 3 )
	    Short_Block( 2 ) = IOSB( 4 )
	    Dev_Data = Long_Block
	End If
c
	Return
	End



	Subroutine FTP$WRITE_EOF( IOSB )
c
	Integer*2	IOSB( 4 )
c
	Include 'FTP$FLAGS.FOR'
	Include '($IODEF)'
c
	Integer		SYS$QIOW,	QIO_Status,	One_Block
	Integer*2	Short_Block( 2 )
c
	Equivalence	( Short_Block,	One_Block )
c
	QIO_Status = SYS$QIOW	(				! [efn]
	1			,	%Val( FTP$CHANNEL )	! chan
	1			,	%Val( IO$_WRITEOF )	! func
	1			,	IOSB			! [iosb]
	1			,				! [astadr]
	1			,				! [astprm]
	1			,				! [p1]
	1			,				! [p2]
	1			,				! [p3]
	1			,				! [p4]
	1			,				! [p5]
	1			,				! [p6]
	1			)
	If ( .not. QIO_Status ) Call Lib$Signal( %Val(QIO_Status) )
	Short_Block( 2 ) = 0
	Short_Block( 1 ) = IOSB( 1 )
	If ( .not. One_Block ) Call Lib$Signal( %Val(One_Block) )
c
	Return
	End



	Subroutine FTP$SKIP( COUNT, FILE, DISTANCE, STATUS )
c
	Integer		COUNT,		FILE,		DISTANCE
	Integer		STATUS
c
	Include 'FTP$FLAGS.FOR'
	Include '($IODEF)'
c
	Integer		SYS$QIOW,	QIO_Status,	One_Block
	Integer		Function
	Integer*2	IOSB( 4 ),	Short_Block( 2 )
c
	Equivalence	( Short_Block,	One_Block )
c
	Short_Block( 1 ) = COUNT
	Short_Block( 2 ) = 0
c
	If ( FILE ) Then
	    Function = IO$_SKIPFILE
	Else
	    Function = IO$_SKIPRECORD
	End If
c
	QIO_Status = SYS$QIOW	(				! [efn]
	1			,	%Val( FTP$CHANNEL )	! chan
	1			,	%Val( Function )	! func
	1			,	IOSB			! [iosb]
	1			,				! [astadr]
	1			,				! [astprm]
	1			,	%Val( One_Block )	! [p1]
	1			,				! [p2]
	1			,				! [p3]
	1			,				! [p4]
	1			,				! [p5]
	1			,				! [p6]
	1			)
c
	If ( .not. QIO_Status ) Call Lib$Signal( %Val(QIO_Status) )
c
c	*** Store the return status
c
	Short_Block( 2 ) = 0
	Short_Block( 1 ) = IOSB( 1 )
	STATUS = One_Block
c
c	*** Store the number of units skipped
c
	Short_Block( 2 ) = 0
	Short_Block( 1 ) = IOSB( 2 )
	DISTANCE = One_Block
c
	Return
	End



	Subroutine FTP$DUMMY_READ
c
	Include 'FTP$FLAGS.FOR'
	Include '($IODEF)'
c
	Integer		SYS$QIOW,		QIO_Status
	Integer*2	IOSB( 4 ),		Buffer( 7 )
c
	QIO_Status = SYS$QIOW	(				! [efn]
	1			,	%Val( FTP$Channel )	! chan
	1			,	%Val( IO$_READLBLK )	! func
	1			,	IOSB			! [iosb]
	1			,				! [astadr]
	1			,				! [astprm]
	1			,	Buffer			! [p1]
	1			,	%Val( 14 )		! [p2]
	1			,				! [p3]
	1			,				! [p4]
	1			,				! [p5]
	1			,				! [p6]
	1			)
c
	If ( .not. QIO_Status ) Call Lib$Signal( %Val(QIO_Status) )
	Return
	End

