From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,4e569ed9237b0f35 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1992-03-01 21:34:13 PST Newsgroups: comp.sys.dec Path: sparky!uunet!think.com!mips!mips!decwrl!pa.dec.com!decuac!hussar.dco.dec.com!mjr From: mjr@hussar.dco.dec.com (Marcus J. OpenRanum) Subject: Re: Byte swapping between DECs & Suns Message-ID: <1992Mar2.022546.25610@decuac.dec.com> Keywords: Byte, swapping Sender: news@decuac.dec.com (USENET News System) Nntp-Posting-Host: hussar.dco.dec.com Organization: Digital Equipment Corporation, Washington ULTRIX Resource Center References: <1992Mar2.020300.26694@syd.dms.CSIRO.AU> Date: Mon, 2 Mar 1992 02:25:46 GMT chriss@dmssyd.syd.dms.CSIRO.AU (Chris Skelsey) writes: > >we are trying >to locate a public domain utility/function to swap bytes for various data >types (since the byte ordering of Suns & DECs is different). Take a look at the man pages for htons() and htonl(), ntohl() and ntohs() - they're a starting point, though they have the disadvantage of converting everything to big-endian, so the little-endian machines take an unfair hit. That's what you get for going against the tide and using those big-endian machines. :) mjr. -- Oxymorons: Jumbo shrimp. Informed Consumer. 1Mb "Microkernel". Open UNIX(tm)*. - notebooks of a heretic. *(UNIX is a Registered trademark of Unix Systems Labs)