
                               					20-May-1983 10:30:45	VAX-11 FORTRAN V3.2-37              Page   1
								10-May-1983 10:47:37	CAD$VOLSET:[GARY.STATS.SOURCE]TRNLOG.FOR;5  

0001    !
0002    !			  COPYRIGHT (c) 1982 BY
0003    !	      MOSTEK CORPORATION, CARROLLTON TX
0004    !
0005    ! This software is furnished under a license and may be used and  copied
0006    ! only  in  accordance  with  the  terms  of  such  license and with the
0007    ! inclusion of the above copyright notice.  This software or  any  other
0008    ! copies  thereof may not be provided or otherwise made available to any
0009    ! other person.  No title to and ownership of  the  software  is  hereby
0010    ! transferred.
0011    !
0012    ! The information in this software is subject to change  without  notice
0013    ! and  should  not  be  construed  as  a commitment by MOSTEK
0014    ! CORPORATION.
0015    !
0016    ! MOSTEK assumes no responsibility for the use or  reliability  of  its
0017    ! software on equipment which is not supplied by MOSTEK.
0018    !
0019     
0020    !++
0021    ! FACILITY:
0022    !   MOSTEK CORPORATION
0023    !
0024    ! ABSTRACT:
0025    !   This subroutine will convert the logical name
0026    !   lognam into the final device name using the
0027    !   system service routine SYS$TRNLOG until there
0028    !   is no more change in the name.
0029    !   
0030    !
0031    ! ENVIRONMENT:
0032    !   VAX11 VMS
0033    !
0034    ! AUTHOR: Gary Smith, CREATION DATE: 6/24/82
0035    !
0036    ! MODIFIED BY:
0037    !
0038    !--
0039    !
0040    ! TABLE OF CONTENTS:
0041    !
0042    !
0043    ! INCLUDE FILES:
0044    !   none
0045    !
0046    ! MACROS:
0047    !   none
0048    !
0049    ! EQUATED SYMBOLS:
0050    !   none
0051    !
0052    ! EXTERNAL REFERENCES:
0053    !   SS$_NORMAL
0054    !   SS$_NOTRANS
0055    !   SYS$TRNLOG
0056     
0057    !++

                               					20-May-1983 10:30:45	VAX-11 FORTRAN V3.2-37              Page   2
								10-May-1983 10:47:37	CAD$VOLSET:[GARY.STATS.SOURCE]TRNLOG.FOR;5  

0058    ! FUNCTIONAL DESCRIPTION:
0059    !   this subroutine will convert the logical name
0060    !   lognam into the final device name using the1
0061    !   system service routine SYS$TRNLOG until there
0062    !   is no more change in the name.
0063    !
0064    !
0065    ! FORMAL PARAMETERS:
0066    !   lognam - the name of the logical variable to translated
0067    !   devnam - translated value of the logical
0068    !   dvsize - length of the translation
0069    !   permdv - is it a permaneant device?
0070    !
0071    ! IMPLICIT INPUTS:
0072    !   none
0073    !
0074    !
0075    ! IMPLICIT OUTPUTS:
0076    !   none
0077    !
0078    !
0079    ! ROUTINE VALUE and
0080    ! COMPLETION CODES:
0081    !   none
0082    !
0083    !
0084    ! SIDE EFFECTS:
0085    !   none
0086    !
0087    !
0088    !--
0089          subroutine trnlog(lognam,devnam,dvsize,permdv)
0090     
0091          logical permdv
0092          integer i,dvsize
0093          integer SYS$TRNLOG
0094          character*(*) lognam,devnam
0095          character*64 name1,name2
0096    !
0097          external ss$_normal
0098          external ss$_notran
0099    !
0100          permdv = .false.
0101          len1 = min(63,len(lognam))
0102          name1 = lognam(1:len1)
0103    !++
0104    ! convert the name until ss$_notran is returned
0105    !--
0106    10    i = SYS$TRNLOG(name1(1:len1),len2,name2,,,)
0107     
0108          if (name2(len2:len2).eq.':') len2 = len2-1
0109          if (i .eq. %LOC(SS$_NORMAL) ) goto 20
0110          if (i .ne. %LOC(SS$_NOTRAN) ) goto 100
0111     
0112          dvsize = min(len(devnam),len2)
0113          devnam = name2(1:dvsize)
0114     

TRNLOG                         					20-May-1983 10:30:45	VAX-11 FORTRAN V3.2-37              Page   3
								10-May-1983 10:47:37	CAD$VOLSET:[GARY.STATS.SOURCE]TRNLOG.FOR;5  

0115          if (ichar(name2(1:1)).ne.'1B'X) goto 200
0116          if (ichar(name2(2:2)).ne.0) goto 200
0117     
0118          dvsize = dvsize-4
0119          devnam = name2(5:len2)
0120          permdv = .true.
0121          goto 200
0122    !
0123    20    i = SYS$TRNLOG(name2(1:len2),len1,name1,,,)
0124    !     type 2000,name2(1:len2),name1(1:len1),len1,len2,i
0125     
0126          if (name1(len1:len1).eq.':') len1 = len1-1
0127          if (i .eq. %LOC(SS$_NORMAL) ) goto 10
0128          if (i .ne. %LOC(SS$_NOTRAN) )goto 100
0129     
0130          dvsize = min(len(devnam),len1)
0131          devnam = name1(1:dvsize)
0132     
0133          if (ichar(name1(1:1)).ne.'1B'X) goto 200
0134          if (ichar(name1(2:2)).ne.0) goto 200
0135     
0136          dvsize = dvsize-4
0137          devnam = name1(5:len1)
0138          permdv = .true.
0139          goto 200
0140     
0141    !++
0142    ! on erroneous return code, bomb out nicely
0143    !--
0144     
0145    100   continue
0146     
0147    !++
0148    ! all done, return
0149    !--
0150     
0151    200   return
0152          end

TRNLOG                         					20-May-1983 10:30:45	VAX-11 FORTRAN V3.2-37              Page   4
								10-May-1983 10:47:37	CAD$VOLSET:[GARY.STATS.SOURCE]TRNLOG.FOR;5  

PROGRAM SECTIONS

    Name				 Bytes   Attributes

  0 $CODE                                  375   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG
  2 $LOCAL                                 240   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG

    Total Space Allocated                  615


ENTRY POINTS

    Address  Type  Name                      References

  0-00000000       TRNLOG                       89     


VARIABLES

    Address  Type  Name          Attributes  References

 AP-00000008@ CHAR DEVNAM                       89        94       112       113=      119=      130       131=      137=    
 AP-0000000C@ I*4  DVSIZE                       89        92       112=      113       118(2)=   130=      131       136(2)= 
  2-00000080  I*4  I                            92       106=      109       110       123=      127       128     
  2-00000084  I*4  LEN1                        101=      102       106       123A      126(4)=   130       137     
  2-00000088  I*4  LEN2                        106A      108(4)=   112       119       123     

 AP-00000004@ CHAR LOGNAM                       89        94       101       102     
  2-00000000  CHAR NAME1                        95       102=      106A      123A      126       131       133       134     
					       137     
  2-00000040  CHAR NAME2                        95       106A      108       113       115       116       119       123A    
 AP-00000010@ L*4  PERMDV                       89        91       100=      120=      138=    


LABELS

    Address   Label                          References

  0-0000003F  10                               106#      127     
  0-000000DE  20                               109       123#    
  0-00000176  100                              110       128       145#    
  0-00000176  200                              115       116       121       133       134       139       151#    


FUNCTIONS AND SUBROUTINES REFERENCED

  Type  Name                                 References

        SS$_NORMAL                              97       109       127     
        SS$_NOTRAN                              98       110       128     
   I*4  SYS$TRNLOG                              93       106       123     

TRNLOG                         					20-May-1983 10:30:45	VAX-11 FORTRAN V3.2-37              Page   5
								10-May-1983 10:47:37	CAD$VOLSET:[GARY.STATS.SOURCE]TRNLOG.FOR;5  

  +----------------------------------------------+
  |           KEY TO REFERENCE FLAGS             |
  |   =   - Value Modified                       |
  |   #   - Defining Reference                   |
  |   A   - Actual Argument, possibly modified   |
  |   D   - Data Initialization                  |
  |  (n)  - Number of occurrences on line        |
  +----------------------------------------------+



COMMAND QUALIFIERS

  FORTRAN /DEBUG/OBJECT=OBJ:TRNLOG/LIST=LIS:TRNLOG/CONT=99/CROSS/NOOPT SRC:TRNLOG

  /CHECK=(NOBOUNDS,OVERFLOW,NOUNDERFLOW)
  /DEBUG=(SYMBOLS,TRACEBACK)
  /STANDARD=(NOSYNTAX,NOSOURCE_FORM)
  /SHOW=(NOPREPROCESSOR,NOINCLUDE,MAP)
  /F77  /NOG_FLOATING  /I4  /NOOPTIMIZE  /WARNINGS  /NOD_LINES  /CROSS_REFERENCE  /NOMACHINE_CODE  /CONTINUATIONS=99


COMPILATION STATISTICS

  Run Time:           1.84 seconds
  Elapsed Time:       5.03 seconds
  Page Faults:        384
  Dynamic Memory:     808 pages
