Thread View: borland.public.cppbuilder.nativeapi
4 messages
4 total messages
Started by Boba
Thu, 02 Mar 2006 18:39
big endian
Author: Boba
Date: Thu, 02 Mar 2006 18:39
Date: Thu, 02 Mar 2006 18:39
3 lines
829 bytes
829 bytes
hallo, wanna ask you if there's a native/vcl utility to handle big endians? thanx. boba.
Re: big endian
Author: Alan Bellingham
Date: Thu, 02 Mar 2006 18:55
Date: Thu, 02 Mar 2006 18:55
18 lines
1420 bytes
1420 bytes
"Boba" <Boba@somewhere.world> wrote:
>hallo,
>wanna ask you if there's a native/vcl utility to handle big endians?
I'm not sure what you're after, but you might find that htonl(),
htons(), ntohl() and ntohs() are what you're after. They convert
unsigned shorts and unsigned longs between machine native ('host') order
and the tcp/ip ('network') order.
(See winsock2.h)
There are also similar functions with the WSA prefix, but which are more
complicated and which don't, on first sight, do anything extra.
Alan Bellingham
--
ACCU Conference 2006 - 19-22 April, Randolph Hotel, Oxford, UK
Re: big endian
Author: Boba
Date: Fri, 03 Mar 2006 16:41
Date: Fri, 03 Mar 2006 16:41
20 lines
1656 bytes
1656 bytes
"Alan Bellingham" <alanb@episys.com> wrote in message
news:gife025lrvhio05ru5aqo85pt38r80b7pf@4ax.com...
> ...
> I'm not sure what you're after, but you might find that htonl(),
> htons(), ntohl() and ntohs() are what you're after. They convert
> unsigned shorts and unsigned longs between machine native ('host')
order
> and the tcp/ip ('network') order.
>
> (See winsock2.h)
>
> There are also similar functions with the WSA prefix, but which are
more
> complicated and which don't, on first sight, do anything extra.
>
> Alan Bellingham
> --
> ACCU Conference 2006 - 19-22 April, Randolph Hotel, Oxford, UK
Yhank you, Alan. I need'em for a project on font designing. Turns
out font files use motorola convention. How about 2.14 floats?
Re: big endian
Author: Michael Gillen
Date: Fri, 03 Mar 2006 19:18
Date: Fri, 03 Mar 2006 19:18
13 lines
1039 bytes
1039 bytes
Boba wrote: > hallo, > wanna ask you if there's a native/vcl utility to handle big endians? > thanx. boba. #define HILO(a) ((((a)>>8) & 0xff) | (((a)<<8) & 0xff00)) /* Set HI-LO order */ #define LHILO(a) ((HILO((a) & 0xffff)<<16)+HILO((a)>>16)) int dataSize = LHILO(Header->dwDataSize) -- -Michael Gillen
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads