comp.lang.ada
 help / color / mirror / Atom feed
* Re: How to FD_SET in Ada on Linux?
  1999-03-03  0:00 How to FD_SET in Ada on Linux? Steve Doiel
@ 1999-03-03  0:00 ` nabbasi
  1999-03-04  0:00   ` David C. Hoos, Sr.
  1999-03-04  0:00 ` dennison
  1999-03-07  0:00 ` Tarjei Tj�stheim Jensen
  2 siblings, 1 reply; 6+ messages in thread
From: nabbasi @ 1999-03-03  0:00 UTC (permalink / raw)


In article <36ddfd4e.0@news.pacifier.com>, "Steve says...
>
>I am porting my sockets interface from Windows NT to Red Hat Linux 5.1.
>
>In 'C'  FD_ZERO, FD_SET, FD_CLR, and FD_ISSET are implemented as macros in
>the file /usr/include/selectbits.h
>
 

if you download the Florist source tree, you should see this implemented
in there.

check my web page for pointer to where florist is

http://home.pacbell.net/nma123
 
Nasser




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

* How to FD_SET in Ada on Linux?
@ 1999-03-03  0:00 Steve Doiel
  1999-03-03  0:00 ` nabbasi
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Steve Doiel @ 1999-03-03  0:00 UTC (permalink / raw)


I am porting my sockets interface from Windows NT to Red Hat Linux 5.1.

In 'C'  FD_ZERO, FD_SET, FD_CLR, and FD_ISSET are implemented as macros in
the file /usr/include/selectbits.h

I would like to replicate their functionality in Ada, but am having a great
deal of difficulty in demangling the C code.  Has anyone already implemented
these functions in Ada?

Note: I already looked at GNAT's System.Garlic.Thin which defines FD_SET but
does not define any of these operations.

Thanks in advance,
SteveD






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

* Re: How to FD_SET in Ada on Linux?
  1999-03-04  0:00   ` David C. Hoos, Sr.
@ 1999-03-04  0:00     ` nabbasi
  0 siblings, 0 replies; 6+ messages in thread
From: nabbasi @ 1999-03-04  0:00 UTC (permalink / raw)


In article <7blv66$8j9@hobbes.crc.com>, "David says...
 
>I would stay away from the 3.12w.fsu version, because it looks like 
>it's for the fsu GNAT runtime.
 
hi,

I build the above on linux 2.0.36 (red hat 5.2), you need to set the
GNAT threads libraries to point to the Linux native ones, not the
FSU threads. Instructions how to do this in GNAT readme.

Nasser




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

* Re: How to FD_SET in Ada on Linux?
  1999-03-03  0:00 ` nabbasi
@ 1999-03-04  0:00   ` David C. Hoos, Sr.
  1999-03-04  0:00     ` nabbasi
  0 siblings, 1 reply; 6+ messages in thread
From: David C. Hoos, Sr. @ 1999-03-04  0:00 UTC (permalink / raw)



nabbasi@pacbell.net wrote in message <7bl5pf$jik@drn.newsguy.com>...
>In article <36ddfd4e.0@news.pacifier.com>, "Steve says...
>>I am porting my sockets interface from Windows NT to Red Hat Linux 5.1.
>>In 'C'  FD_ZERO, FD_SET, FD_CLR, and FD_ISSET are implemented as macros in
>>the file /usr/include/selectbits.h
>if you download the Florist source tree, you should see this implemented
>in there.


It's not quite as simple as that.
Several years ago, when I did my first sockets implementation in Ada (long before GNAT), I dutifully translated all the macros to
Ada subprograms, and life was good until our UNIX vendor came out with a new version to which our customer insisted we migrate.
Well, one thing in the C header files changed which rendered our Ada code incompatible, and it was difficult to find the cause of
our large system's aberrant behavior.

Then, we realized that the better course was to automatically generate C-functions implementing those macros, and interface Ada to
those C functions, the approach which florist uses.

In the florist sources, you will not find Ada implementations, but c-implementations to which the Ada code is interfaced.

So.. I would recommend you just get and install florist.  I haven't built the RedHat 5.1 florist981211.tar.gz (the current version),
so I cannot comment specifically, but there are sure to be some things which will not work.  Most of the time I found these were
things in which I was not interested, or could see how to fix -- some with the kind help of Ted Baker and the folks at ACT (I had a
support contract on that project).

I would stay away from the 3.12w.fsu version, because it looks like it's for the fsu GNAT runtime.

I have used florist (and its predecessor forest) for several years, now on several platforms, and have found it useful, in spite of
its flaws.









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

* Re: How to FD_SET in Ada on Linux?
  1999-03-03  0:00 How to FD_SET in Ada on Linux? Steve Doiel
  1999-03-03  0:00 ` nabbasi
@ 1999-03-04  0:00 ` dennison
  1999-03-07  0:00 ` Tarjei Tj�stheim Jensen
  2 siblings, 0 replies; 6+ messages in thread
From: dennison @ 1999-03-04  0:00 UTC (permalink / raw)


In article <36ddfd4e.0@news.pacifier.com>,
  "Steve Doiel" <nospam_steved@pacifier.com> wrote:
> I am porting my sockets interface from Windows NT to Red Hat Linux 5.1.
>
> In 'C'  FD_ZERO, FD_SET, FD_CLR, and FD_ISSET are implemented as macros in
> the file /usr/include/selectbits.h
>
> I would like to replicate their functionality in Ada, but am having a great
> deal of difficulty in demangling the C code.  Has anyone already implemented
> these functions in Ada?

Hmm. Don't some C compilers have a mode where they just expand the macros and
quit?

T.E.D.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

* Re: How to FD_SET in Ada on Linux?
  1999-03-03  0:00 How to FD_SET in Ada on Linux? Steve Doiel
  1999-03-03  0:00 ` nabbasi
  1999-03-04  0:00 ` dennison
@ 1999-03-07  0:00 ` Tarjei Tj�stheim Jensen
  2 siblings, 0 replies; 6+ messages in thread
From: Tarjei Tj�stheim Jensen @ 1999-03-07  0:00 UTC (permalink / raw)




Steve Doiel wrote:

> I am porting my sockets interface from Windows NT to Red Hat Linux 5.1.
>
> In 'C'  FD_ZERO, FD_SET, FD_CLR, and FD_ISSET are implemented as macros in
> the file /usr/include/selectbits.h
>
> I would like to replicate their functionality in Ada, but am having a great
> deal of difficulty in demangling the C code.  Has anyone already implemented
> these functions in Ada?

The easiest way of doing this would perhaps be to write a C program that emitted
an Ada module which containes the correct values for these and other constants.
An alternative would perhaps be to use Perl instead of C. However I suspect that
a C version will be easiest to handle. It should assure portability to other
operating systems as the values would always be correct.

Greetings,






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

end of thread, other threads:[~1999-03-07  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-03  0:00 How to FD_SET in Ada on Linux? Steve Doiel
1999-03-03  0:00 ` nabbasi
1999-03-04  0:00   ` David C. Hoos, Sr.
1999-03-04  0:00     ` nabbasi
1999-03-04  0:00 ` dennison
1999-03-07  0:00 ` Tarjei Tj�stheim Jensen

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