Files
Digital-Research-Source-Code/CPM OPERATING SYSTEMS/CPM 68K/1.2 SOURCE/6/GETL.C
Sepp J Morris 31738079c4 Upload
Digital Research
2020-11-06 18:50:37 +01:00

39 lines
1.2 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**************************************************************************
*
* g e t l F u n c t i o n
* -------------------------
* Copyright 1982 by Digital Research Inc. All rights reserved.
*
* "getl" gets an LONG (4 byte) value from the input stream.
* Note that what's written (binary) by a PDP 11 (UNIX: lo byte, hi byte)
* system will NOT be compatible with what's written by a
* 68K (NUXI: hi byte, lo byte) system.
*
* Calling sequence:
* l = getl(stream)
* Where:
* l = a 32-bit long value
* stream-> a (FILE *) input stream
*
*****************************************************************************/
#include "stdio.h"
LONG getl(sp) /* CLEAR FUNCTION ***********/
REG FILE *sp; /* the stream to get from */
{ /* */
LONG l; /* place to get to */
REG BYTE *p; /* make ptr to l */
/****************************/
p = (char *)&l; /* point to l */
*p++ = getc(sp); /* no way to distinguish */
*p++ = getc(sp); /* twixt EOF & -1 */
*p++ = getc(sp); /* */
*p++ = getc(sp); /* */
return(l); /* there it is */
} /****************************/
 */
} /****************************/
 */
} /****************************/