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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM 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,ASCII Path: g2news2.google.com!postnews.google.com!g21g2000yqk.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: for S'Image use Func?? Date: Tue, 11 May 2010 00:58:16 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <4be417b4$0$6992$9b4e6d93@newsspool4.arcor-online.net> <1qcb6z4i20dyb.1dz2hd4c0vx69.dlg@40tude.net> NNTP-Posting-Host: 137.138.182.236 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1273564696 31329 127.0.0.1 (11 May 2010 07:58:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 11 May 2010 07:58:16 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: g21g2000yqk.googlegroups.com; posting-host=137.138.182.236; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:11484 Date: 2010-05-11T00:58:16-07:00 List-Id: On 11 Maj, 00:24, Yannick Duch=EAne (Hibou57) wrote: > Only as long as you only rely on fopen ; This function is defined in the C standard. > there is also an "int open(char * =A0 > filename, int flags)" which is widely used. This one is not defined in the C standard and as such is not part of the C language. > Weither or not this "int" =A0 > actually stands for a pointer is another story (as in C one will always b= e =A0 > able to cast from int to void*, this may be true indeed). No this is not true either - assuming that you mean the "open" function defined in the POSIX standard, the return value is the lowest *numbered* unused file descriptor. This is aligned with the semantics of other functions like select. Another reason for why this cannot be a pointer is that NULL is defined to be a pointer value that does *not* point to any object; at the same time STDIN_FILENO, denoting a file descriptor for standard input, has a value 0, which is equivalent to NULL. Since standard input cannot exist and not exist at the same time (quantum computers might change this...), the descriptor value cannot be a pointer. Interestingly, Unix file descriptors are *much safer* than standard C's FILE pointers in that they are free from undefined behavior. Of course, it would be even better to have a distinct type for them. (OK, that's enough for off-topic confusions, I duck away to reinvent My_Better.Text_IO on top of Ada.Streams ;-) ) -- Maciej Sobczak * http://www.inspirel.com YAMI4 - Messaging Solution for Distributed Systems http://www.inspirel.com/yami4