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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b758510908fd9ba7 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada 95 Sourcecode References: <25efd45a.0411081909.26db3982@posting.google.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <3E7kd.9648$O11.7005@newsread3.news.pas.earthlink.net> Date: Tue, 09 Nov 2004 18:03:43 GMT NNTP-Posting-Host: 63.184.8.128 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.pas.earthlink.net 1100023423 63.184.8.128 (Tue, 09 Nov 2004 10:03:43 PST) NNTP-Posting-Date: Tue, 09 Nov 2004 10:03:43 PST Xref: g2news1.google.com comp.lang.ada:6090 Date: 2004-11-09T18:03:43+00:00 List-Id: Comparisons between Ada and C that involve text I/O are biased in favor of C because the Ada versions typically use Ada.Text_IO. Text_IO is a very heavyweight implementation of text I/O, given all the column, line, and page counting that must go on. I've created a thick binding to the C text I/O library (fopen, fclose, fgetc, fgets, fputc, fputs) to use in such cases, or when the speed difference is important. The main source of errors (supplying the wrong length to fgets) is isolated to one place, and uses 'Length to get the length right. It involves a small C file to provide access to the standard file handles. I've been able to use it with GNAT 3.15p and the C compiler that comes with it. I have not been able to test it with another Ada compiler, because I don't have C compilers that produce output in a format that they accept. I would appreciate it if people would test the binding with other compilers, and will provide it to anyone who wants to use it with GNAT as well. If it proves to be fairly portable, I'll make it more easily available. E-mail me at jrcarter [at-sign] acm [period | full stop] org if you're interested. -- Jeff Carter "C's solution to this [variable-sized arrays] has real problems, and people who are complaining about safety definitely have a point." Dennis Ritchie 25