comp.lang.ada
 help / color / mirror / Atom feed
From: smize@news.imagin.net (Samuel Mize)
Subject: Re: Pragma Import to C "Accept" function?
Date: 1997/02/20
Date: 1997-02-20T00:00:00+00:00	[thread overview]
Message-ID: <5ej416$17k1@prime.imagin.net> (raw)
In-Reply-To: 5dv9kc$3sr@ash.ridgecrest.ca.us


In article <5dv9kc$3sr@ash.ridgecrest.ca.us>,
Do-While Jones <do_while@lo-pan.ridgecrest.ca.us> wrote:

>In article <5ds893$qgf@bs33n.staffs.ac.uk> cm3bcawp@bs47c.staffs.ac.uk
(Al Priest) writes:
>>I'm looking for a "nice" way to interface to the C accept function. Given
>>it's clash with the reserved word accept, is there a good way to interface
>>to the function?
 
and answered, correctly for Ada 83, with Telesoft Telegen 2 on a Sun:
 
>function accept_connection(
>  socket  : in Socket_numbers;
>  addr    : in SYSTEM.Address;
>  addrlen : in SYSTEM.Address)
>  return Socket_numbers;
>pragma Interface (C, accept_connection);
>pragma Interface_Information
>  (accept_connection, "_accept");
 
or on Verdix/SGI:
 
>pragma Interface_Name
>  (accept_connection, "accept");
 
These pragmas are vendor-specific.  In Ada95, the pragma Export is
available, which combines the functions of Interface and Interface_Name
(or Interface_Information).

>>I'm using latest (Jan'97) version of Gnat compiler for Linux in case it
>>matters.

It matters.  Unless you're using the -gnat83 switch, you have Ada95, so
you can use pragma Export.

Samuel Mize











  reply	other threads:[~1997-02-20  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-12  0:00 Pragma Import to C "Accept" function? Al Priest
1997-02-12  0:00 ` Samuel Tardieu
1997-02-13  0:00 ` Do-While Jones
1997-02-20  0:00   ` Samuel Mize [this message]
1997-02-24  0:00 ` Robert Dewar
1997-03-04  0:00   ` Al Priest
replies disabled

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