3 /* Copyright (C) 1988-1991 Apple Computer, Inc.
7 * Even though Apple has reviewed this software, Apple makes no warranty
8 * or representation, either express or implied, with respect to this
9 * software, its quality, accuracy, merchantability, or fitness for a
10 * particular purpose. As a result, this software is provided "as is,"
11 * and you, its user, are assuming the entire risk as to its quality
14 * This code may be used and freely distributed as long as it includes
15 * this copyright notice and the warranty information.
17 * Machine-independent I/O routines for 8-, 16-, 24-, and 32-bit integers.
19 * Motorola processors (Macintosh, Sun, Sparc, MIPS, etc)
20 * pack bytes from high to low (they are big-endian).
21 * Use the HighLow routines to match the native format
24 * Intel-like machines (PCs, Sequent)
25 * pack bytes from low to high (the are little-endian).
26 * Use the LowHigh routines to match the native format
29 * These routines have been tested on the following machines:
30 * Apple Macintosh, MPW 3.1 C compiler
31 * Apple Macintosh, THINK C compiler
32 * Silicon Graphics IRIS, MIPS compiler
34 * Digital Equipment VAX
37 * Implemented by Malcolm Slaney and Ken Turkowski.
39 * Malcolm Slaney contributions during 1988-1990 include big- and little-
40 * endian file I/O, conversion to and from Motorola's extended 80-bit
41 * floating-point format, and conversions to and from IEEE single-
42 * precision floating-point format.
44 * In 1991, Ken Turkowski implemented the conversions to and from
45 * IEEE double-precision format, added more precision to the extended
46 * conversions, and accommodated conversions involving +/- infinity,
47 * NaN's, and denormalized numbers.
49 * $Id: portableio.h,v 1.1 2003/06/16 20:00:50 herman Exp $
51 * $Log: portableio.h,v $
52 * Revision 1.1 2003/06/16 20:00:50 herman
55 * Revision 1.1.1.1 2002/06/21 12:35:26 myrina
58 * Revision 1.1.1.1 2001/10/01 03:14:55 heroine
61 * Revision 1.1.1.1 2001/10/01 02:51:42 root
64 * Revision 1.3 2001/07/15 12:16:31 mikecheng
65 * Removed a whooooole heap of unused functions
67 * Revision 1.2 2001/07/04 09:51:36 uid43892
68 * everything passed through 'indent *.c *.h'
70 * Revision 1.1.1.1 2001/07/01 06:54:47 mikecheng
71 * This is v0.30 of toolame. A fresh start consisting of the dist10 code with
72 * all layerI and layerIII removed.
74 * Revision 2.6 91/04/30 17:06:02 malcolm
78 #include "ieeefloat.h"
86 extern CLINK defdouble
ReadIeeeExtendedHighLow (FILE * fp
);
87 extern CLINK
int Read16BitsHighLow (FILE * fp
);
88 extern CLINK
void Write32BitsHighLow (FILE * fp
, int i
);
90 extern CLINK
int Read32BitsHighLow (FILE * fp
);
91 extern CLINK
void ReadBytes (FILE * fp
, char *p
, int n
);