comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org>
Subject: Re: adasockets and adatypes
Date: Thu, 6 Sep 2001 10:16:34 -0400
Date: 2001-09-06T14:16:36+00:00	[thread overview]
Message-ID: <9n80g4$o9r$1@nh.pace.co.uk> (raw)
In-Reply-To: x7vpu96ehbx.fsf@smaug.pushface.org

Not exactly sure I understand what you are describing, but I will say this:
I've used C to read/write data to a stream and usually, I've resorted to
having some function that manually tore the data apart and put it into the
stream - not dissimilar to creating a 'Read or 'Write procedure for some
structure. I've had to do that because C didn't provide a good way for me to
control where the bits and bytes fell within a struct and the minute
something got the least bit unusual, you just couldn't get there with its
lame representation specifications. In simpler cases where I got to define
the message content, you could basically build a struct that was at least
consistent and do some kind of overlay or similar pointer tricks to just get
it as a stream of bytes.

As for endianness and/or some kind of general portability, I've not had to
deal with that in C because the environment was usually self-contained
enough that you could be sure that both ends were doing the same thing.
Those who insist on absolute portability don't have the balls to live in the
real world. :-)

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"Simon Wright" <simon@pushface.org> wrote in message
news:x7vpu96ehbx.fsf@smaug.pushface.org...
>
> I would have thought the ideal non-automated C way of doing this would
> be to define a wire format that is convenient for manipulating
> endianness (eg, no packing) and manually stuff this on the way
> out/unstuff on the way in. Far less dangerous than trying to
> manipulate packed data.
>
> Sometimes the transport mechanism forces you to use the same length
> for every component -- eg, X properties, where you can choose 1/2/4
> byte length and the server byteswaps for you.





      parent reply	other threads:[~2001-09-06 14:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-04 10:53 adasockets and adatypes Tony Gair
2001-09-04 11:37 ` David C. Hoos, Sr.
2001-09-04 12:17   ` Florian Weimer
2001-09-04 14:55     ` David C. Hoos
2001-09-04 15:33       ` Ted Dennison
2001-09-04 15:53         ` David C. Hoos
2001-09-04 18:53           ` Ted Dennison
2001-09-04 20:44             ` David C. Hoos
2001-09-04 21:35               ` Ted Dennison
2001-09-04 15:58         ` Marin David Condic
2001-09-05  9:13   ` Tony Gair
2001-09-04 12:02 ` Marc A. Criley
2001-09-04 13:43 ` Marin David Condic
2001-09-04 22:12   ` Simon Wright
2001-09-06  7:04     ` Ole-Hjalmar Kristensen
2001-09-07 13:16       ` Peter Dulimov
2001-09-07 14:46         ` Ted Dennison
2001-09-08  5:51         ` Simon Wright
2001-09-06 14:16     ` Marin David Condic [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox