From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c689b55786a9f2bd X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news4.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!.POSTED!not-for-mail From: Warren Newsgroups: comp.lang.ada Subject: Re: for S'Image use Func?? Date: Wed, 12 May 2010 13:27:17 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <4be417b4$0$6992$9b4e6d93@newsspool4.arcor-online.net> <1qcb6z4i20dyb.1dz2hd4c0vx69.dlg@40tude.net> <1qfu2ba65pd63$.asc7m201hi6u$.dlg@40tude.net> <1x8q3p2gvm9fh.aru6nueicagd$.dlg@40tude.net> Injection-Date: Wed, 12 May 2010 13:27:17 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="9f8M0iN5t54V+4DF/iqO8g"; logging-data="13876"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ktYIaMZ3N/4qbMfSLdhhXKRar4VO0DyQ=" User-Agent: Xnews/5.04.25 X-Face: &6@]C2>ZS=NM|HE-^zWuryN#Z/2_.s9E|G&~DRi|sav9{E}XQJb*\_>=a5"q]\%A;5}LKP][1mA{gZ,Q!j Cancel-Lock: sha1:l8OtdvUoStauMx1fDvofPo4lcWY= Xref: g2news2.google.com comp.lang.ada:11549 Date: 2010-05-12T13:27:17+00:00 List-Id: Dmitry A. Kazakov expounded in news:1x8q3p2gvm9fh.aru6nueicagd$.dlg@40tude.net: > On Tue, 11 May 2010 20:56:11 +0000 (UTC), Warren wrote: > >> Dmitry A. Kazakov expounded in news:1qfu2ba65pd63$.asc7m201hi6u$.dlg@ >> 40tude.net: >> >>> On Tue, 11 May 2010 17:17:38 +0000 (UTC), Warren wrote: >>> >>>> =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= >>>> expounded >> in >>>> news:op.vcig7go1ule2fv@garhos: >>>> >>>>> Le Mon, 10 May 2010 22:56:11 +0200, Maciej Sobczak >>>>> a écrit: >>>>>> Coming back to I/O - what I miss in Ada is the equivalent of >>>>>> fread >> in >>>>>> C - that is, an operation that reads *up to* the given number of >>>>>> bytes. Or maybe there is something that I didn't notice? >>>> >>>>> It's there : look at [ARM 2005 13.13.1] which defines the package >>>>> Ada.Streams, which in turn contains the following : >>>>> >>>>> type Root_Stream_Type is abstract tagged limited private; >>>>> ... >>>>> type Stream_Element is mod implementation-defined; >>>>> ... >>>> ... >>>>> Well, to be honest, this is not exactly the same as with C, as >>>>> Ada.Streams.Stream_Element is implementation defined (which is >>>>> good, because this is indeed platform dependent), so you will >>>>> need .. >>>> >>>> All this is well and good for applications that can work in >>>> "implementation defined" units of type Stream_Element. A pragma >>>> won't fix the problem should it be different than a byte. Granted, >>>> it will never likely come up on the platforms I have in mind. >>> >>> If you to read a character stream, just do so: >>> >>> Item := Character'Read (S); >>> Character'Write (S, Item); >>> >>> For octet streams use Unsigned_8. >> >> But this has to include seeking in the stream as well. > > Repeat reading n times. > >> Can you guarantee seeking to an arbitrary "byte boundary"? > > On a machine with 13 bis per character? Can you define "byte > boundary"? The point is that if Stream_Element is not 8 bits, and the > environment supports streams of octets, then I see no reason why Ada > vendor would implement Unsigned_8r'Read incompatible with that. On those machines, you're not going to have standard C I/O either. That's an purely academic case. But the issue I am taking, are machines that define multiples of a byte. Warren