home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
modcomp
/
dgetli.
< prev
next >
Wrap
Text File
|
1987-01-25
|
5KB
|
156 lines
INTEGER FUNCTION DGETLI (ALIN,CH)
C
C ****************************************************************
C
C KERMIT for the MODCOMP MAXIV operating system
C
C Compliments of:
C
C SETPOINT, Inc.
C 10245 Brecksville Rd.
C Brecksville, Ohio 44141
C
C
C KERMIT is a copyrighted protocol of Columbia Univ. The authors
C of this version hereby grant permission to copy this software
C provided that it is not used for an explicitly commercial
C purpose and that proper credit be given. SETPOINT, Inc. makes
C no warranty whatsoever regarding the accuracy of this package
C and will assume no liability resulting from it's use.
C
C ****************************************************************
C
C Abstract: Get a line of compressed source from a disk file and
C uncompress the line, unpack it (convert to 1 char
C per word) and put a CR/EOS after the last nonblank
C character.
C
C MODIFICATION HISTORY
C
C BY DATE REASON PROGRAMS AFFECTED
C
C ****************************************************************
C
C Author: Rick Burke Version: A.0 Date: Aug-86
C
C Calling Parameters:
C
C W ALIN - Line of text to be returned to the caller
C R CH - UFT number to be used for the read
C
C ****************************************************************
C
C Messages generated by this module : None
C
C ****************************************************************
C
C Subroutines called directly : CMR4, IAND, ISHFT
C
C ****************************************************************
C
C Files referenced : None
C
C ****************************************************************
C
C Local variable definitions :
C
C ACOUNT - Index variable for return array
C I - Index variable
C IEND - End-of-file indicator
C LEN - Length of uncompressed source line
C MLEFT - Mask used to extract left byte of a word
C MRIGHT - Mask used to extract right byte of a word
C CLIN(132) - Uncompressed source read from disk
C
C ****************************************************************
C
C Commons referenced : KERPAR and UFTTBL local commons
C
C ****************************************************************
C
C (*$END.DOCUMENT*)
C
C ****************************************************************
C * *
C * D I M E N S I O N S T A T E M E N T S *
C * *
C ****************************************************************
C
IMPLICIT INTEGER (A-Z)
INTEGER*2 ALIN(132), CLIN(132)
C
C ****************************************************************
C * *
C * T Y P E S T A T E M E N T S *
C * *
C ****************************************************************
C
C
C ****************************************************************
C * *
C * C O M M O N S T A T E M E N T S *
C * *
C ****************************************************************
C
INCLUDE USL/KERPMC
C
INCLUDE USL/UFTTBC
C
C ****************************************************************
C * *
C * E Q U I V A L E N C E S T A T E M E N T S *
C * *
C ****************************************************************
C
C
C ****************************************************************
C * *
C * D A T A S T A T E M E N T S *
C * *
C ****************************************************************
C
DATA MLEFT /Z7F00/, MRIGHT /Z007F/
C
C ****************************************************************
C
C Code starts here :
C
DO 10 I = 1,132
ALIN(I) = 0
CLIN(I) = 0
10 CONTINUE
C
C-----> Read compressed source from the current file position.
C
CALL CMR4 (CLIN,IEND,LEN)
IF (IEND .EQ. 1) GO TO 20
DGETLI = EOF
RETURN
20 CONTINUE
C
C-----> Loop to expand the data to 1 byte per word.
C
DO 30 I = 1,65
ACOUNT = I * 2
ALIN(ACOUNT-1) = ISHFT (IAND (CLIN(I),MLEFT),-8)
ALIN(ACOUNT) = IAND (CLIN(I),MRIGHT)
30 CONTINUE
C
C-----> Remove any trailing blanks.
C
DO 40 I=1,130
ACOUNT = 131 - I
IF (ALIN(ACOUNT) .NE. 0 .AND.
> ALIN(ACOUNT) .NE. BLANK ) GO TO 50
40 CONTINUE
ACOUNT = 0
50 CONTINUE
C
C-----> Add LF and EOS at the end.
C
ALIN(ACOUNT+1) = LF
ALIN(ACOUNT+2) = EOS
DGETLI = OK
RETURN
END