comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Pragma Import to C "Accept" function?
Date: 1997/02/24
Date: 1997-02-24T00:00:00+00:00	[thread overview]
Message-ID: <dewar.856787602@merv> (raw)
In-Reply-To: 5ds893$qgf@bs33n.staffs.ac.uk


Al Priest asks

<<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? Currently the only way I can do it is by writing a C
function to interface to the accept, and then interfacing to that in my
Ada program.>>

No one ever said you must use the same name on the Ada side as on the
C side. It is often nice to do so, but there are many cases where it
is not possible (in addition to the reserved word case, consider
names like _____hello and cases where Hello and hello are different
functions).

You just write

  pragma Import (C, Ada_Name_Of_Function, "C_Name_Of_Function");

e.g. for your case:

  pragma Import (C, C_Accept, "accept");

or somesuch. It would be helpful if you could track down why you had a
misunderstanding here so that whatever text you are using can be clarified.
The RM itself seems clear on this point.





  parent reply	other threads:[~1997-02-24  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
1997-02-24  0:00 ` Robert Dewar [this message]
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