From: Jeffrey Carter <spam@spam.com>
Subject: Re: Ada 95 Sourcecode
Date: Tue, 09 Nov 2004 18:03:43 GMT
Date: 2004-11-09T18:03:43+00:00 [thread overview]
Message-ID: <3E7kd.9648$O11.7005@newsread3.news.pas.earthlink.net> (raw)
In-Reply-To: <G_4kd.716$Bj2.154@trndny01>
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
next prev parent reply other threads:[~2004-11-09 18:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-09 3:09 Ada 95 Sourcecode R. Ivan Kobrinsky
2004-11-09 3:20 ` stephane richard
2004-11-09 4:55 ` tmoran
2004-11-09 5:06 ` tmoran
2004-11-09 5:20 ` David Botton
2004-11-09 8:16 ` tmoran
2004-11-09 15:03 ` Frank J. Lhota
2004-11-09 18:03 ` Jeffrey Carter [this message]
2004-11-10 0:25 ` Georg Bauhaus
2004-11-09 8:27 ` Martin Krischik
2004-11-09 13:25 ` David Botton
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox