Skip to main content.
home | support | download

Back to List Archive

RE: Re: Document properties

From: <STEPHANE_MEIER(at)not-real.Non-HP-Switzerland-om1.om.hp.com>
Date: Fri Sep 03 1999 - 09:03:07 GMT
Thanks for the plugs. I see it can make the code much simpler.
If I have time I will update it with htons and ntohs.

Stephane
-----Original Message-----
From: kg9ae@geocities.com [mailto:kg9ae@geocities.com]
Sent: 3 septembre 1999 04:35
To: swish-e@sunsite.berkeley.edu
Cc: kg9ae@geocities.com
Subject: [SWISH-E] Re: Document properties


>> big endian without a formal proof - anyone to confim this?
> I don't know, it's not in the man page, and no one I ask knows.  If you
> want to write portable code, use network order.  It will be easier to

Here is documentation on the network byte-order conversion functions in the
GNU C Library.

http://www.gnu.org/manual/glibc-2.0.6/html_node/libc_200.html

_BIG_ENDIAN and _LITTLE_ENDIAN are macros provided by many compilers.  They
shouldn't be necessary if the htonl, htons, ntohl, and ntohs functions are
usable across platforms.

As a note: The network byte order is big endian.  Intel 16/32-bit 80x86 
CPUs
are little endian; SUN SPARCs and Compaq Alpha are big endian; Motorola/IBM
PowerPC, Intel ArmStrong (8096x), Intel IA-64 (64-bit Pentium or whatever),
and other newer CPUs are swappable between big or little endian in hardware
depending on the operating system's requirements.  (Furthermore, 64-bit
Linux runs as little endian on IA-64 while it runs as big endian on Alpha
and SPARC.)

,David Norris

World Wide Web - http://www.webaugur.com/dave
Page via mail - 412039@pager.mirabilis.com
ICQ Universal Internet Number - 412039
E-Mail - dave@webaugur.com
Received on Fri Sep 3 01:57:52 1999