TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Bo Simonsen
from: Pascal Schmidt
date: 2004-01-20 18:36:14
subject: Re: Big endian machines

Hi Bo! :-)

 PS>> What is an sword supposed to be? I'd stick to standard names.
 BS> signed words afair. Anyhow it has the same lenght as a word have, 
 BS> which is 2 bytes..
This is called uint16_t by the C standard's . ;) That's the
most useful definition for such a type since it is guaranteed to work no
matter what the word size of the underlying machine is.

 BS> I should be little endian, fidonet packages should be send in little 
 BS> endian, so I guess I just run a htonl on the words?
htonl will swap the bytes on a little endian machine, and not swap them on
a big endian machine. Network byte order is big endian.

It looks like you will need to code your own routines that behave the other
way round.

Ciao
Pascal

--- Msged/LNX 6.1.1
* Origin: Linux FAQ - http://www.tzi.de/~pharao90/faq/ (1:153/401.2)
SEEN-BY: 633/267 270
@PATH: 153/401 307 140/1 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.