Re: endianess ?


Subject: Re: endianess ?
From: Paul Rohr (paul@abisource.com)
Date: Fri Jan 28 2000 - 12:35:33 CST


At 04:35 PM 1/28/00 +0100, Hubert Figuiere wrote:
>Is there anyway using the XP code from AbiWord to determine the endianess of
>the system it is compiled for ? I'd also like to know if there are endianess
>change functions.

Here are a few different answers. Take your pick:

1. Are you *sure* you want to know local endianness? Other importers which
read binary files are written to do so without making assumptions about
local endian conventions. For example, see what Caolan has done in wv to
make sure that he's reading specific bits and bytes out of the file.

2. There is a flag -- OS_ENDIAN, set in abi/src/config/platforms/*.mk --
which determines which variant of american.hash to install with AbiWord.
AFAIK, it's not used in code anywhere, just to choose one of a pair of files
by name. However, the only reason we're forced to do this is because ispell
was originally written in an endian-sensitive way.

3. If neither 1 nor 2 apply, and you still need them, be sure to create the
appropriate UT_ functions so that everyone else can use them in the future.

>I need it for an import filter I'm writting.

Hmm. Does the content you're importing change depending on the platform
you're currently running on? What happens if somebody tries to open that
same content on a different platform?

Paul



This archive was generated by hypermail 2b25 : Fri Jan 28 2000 - 12:30:11 CST