source: buchla-68k/orig/IOLIB/GETW.C@ 4b63bf3

Last change on this file since 4b63bf3 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Imported original source code.

  • Property mode set to 100755
File size: 799 bytes
Line 
1/*
2 =============================================================================
3 getw.c -- get a 68000 word from a stream file
4 Version 2 -- 1987-10-15 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stdio.h"
9
10extern int fgetc();
11
12/*
13 =============================================================================
14 getw(stream) -- get a word from 'stream'
15
16 Reads a word from 'stream' in Motorola 68000 byte order.
17 No special alignment is assumed in the file.
18 =============================================================================
19*/
20
21int
22getw(stream)
23register FILE *stream;
24{
25 int temp;
26 register char *t;
27
28 t = &temp;
29
30 *t++ = fgetc(stream);
31 *t = fgetc(stream);
32
33 return(temp);
34}
Note: See TracBrowser for help on using the repository browser.