comp.lang.ada
 help / color / mirror / Atom feed
* Advice on low level file handling.
@ 2006-04-02  2:47 Peter C. Chapin
  2006-04-02 10:55 ` Georg Bauhaus
  2006-04-04  1:31 ` Randy Brukardt
  0 siblings, 2 replies; 9+ messages in thread
From: Peter C. Chapin @ 2006-04-02  2:47 UTC (permalink / raw)



I'm working on a program that needs to read an input file on a byte by byte 
basis and examine bit fields and do bitwise shifting in some of these 
bytes. Other parts of the file are to be treated as uninterpreted data 
(this is an OpenPGP message file). Right now I'm using Interfaces.Unsigned_
8 as the type to hold a single byte from the file and I'm instantiating 
Ada.Sequential_IO with this type to get the necessary file reading 
subprograms. So far this seems okay, but I'm wondering if this is the most 
appropriate way to do this. Am I abusing package Interfaces? Should I be 
defining my own modular type or should I be using representation clauses 
with custom record types?

Also I need to count the number of bytes I process and the quantity may 
exceed 2**32. I can define a 64 bit modular type and that seems to work 
fine on gnat. Is that portable? I'm not extremely worried about 
portability, but I'd rather not sacrifice it for no reason.

Thanks for any advice you can offer.

Peter



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-04-07 10:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-02  2:47 Advice on low level file handling Peter C. Chapin
2006-04-02 10:55 ` Georg Bauhaus
2006-04-04  1:31 ` Randy Brukardt
2006-04-05 10:41   ` Peter C. Chapin
2006-04-06  7:43     ` Michael Paus
2006-04-06 12:21       ` Peter C. Chapin
2006-04-06 12:46         ` Dmitry A. Kazakov
2006-04-06 14:13         ` Bob Spooner
2006-04-07 10:48         ` Stephen Leake

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