🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #4196

Re: big endian

#4196
From: Alan Bellingham
Date: Thu, 02 Mar 2006 18:55
18 lines
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
Technical Details
Message-ID: <gife025lrvhio05ru5aqo85pt38r80b7pf@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <44073bf4$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,218aa917182c0f21
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Alan Bellingham <alanb@episys.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: big endian
Date: Thu, 02 Mar 2006 18:55:21 +0000
Reply-To: alanb@episys.com
Message-ID: <gife025lrvhio05ru5aqo85pt38r80b7pf@4ax.com>
References: <44073bf4$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 3.1/32.783
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 193.129.251.253
X-Trace: newsgroups.borland.com 1141325720 193.129.251.253 (2 Mar 2006 10:55:20 -0700)
Lines: 18
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail