home *** CD-ROM | disk | FTP | other *** search
- /*
- digflip.c
-
- % Functions for flipping bytes in loaded words to match machine byte order.
-
- 5/02/88 by Ted.
-
- OWL 1.1
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- */
-
- #include "oakhead.h"
- #include "disppriv.h"
- #include "digutil.h"
-
- typedef struct { byte lo, hi; } split;
-
- /* -------------------------------------------------------------------------- */
-
- void dig_flipshort(usp)
- unsigned short *usp;
- {
- byte tmp;
-
- tmp = ((split *) usp)->lo;
- ((split *) usp)->lo = ((split *) usp)->hi;
- ((split *) usp)->hi = tmp;
- }
- /* -------------------------------------------------------------------------- */
-
- byte DIGPRIV dig_testbyteorder()
- /*
- Determines which kind of byte order the current processor uses.
- */
- {
- unsigned short test;
- byte low;
-
- test = 1;
- low = ((split *)(&test))->lo;
- return((low == 1) ? BO_LSBYTFIRST : BO_MSBYTFIRST);
- }
- /* -------------------------------------------------------------------------- */
-
-