C XXXX-XXX (C) COPYRIGHT IBM CORPORATION 1988
C LICENSED MATERIALS - PROPERTY OF IBM
C REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
C
C IBM CONFIDENTIAL
C
C FORTRAN to C binding for XGKS
C
C    inqlun 
C
C Todd Gill
C TCS Development
C Cambridge MA
C
C $Id: inqlun.f 6358 1998-09-01 17:32:40Z tmap $
C $__Header$
C
C Return the name associated with a Fortran Logical Unit Number.
C Close the file if it's open.
C 
	SUBROUTINE INQLUN(LUN)
	INTEGER LUN
	LOGICAL NAMED,OPENED
	CHARACTER*(255) FNAME
	INQUIRE(UNIT=LUN,NAME=FNAME,NAMED=NAMED,OPENED=OPENED)
	IF (OPENED.AND.NAMED) CLOSE(UNIT=LUN)
	IF (NAMED) CALL SET_FNAME(FNAME)
	RETURN
	END
