comp.lang.ada
 help / color / mirror / Atom feed
From: Samuel Tardieu <sam@ada.eu.org>
To: cm3bcawp@bs47c.staffs.ac.uk (Al Priest)
Subject: Re: Pragma Import to C "Accept" function?
Date: 1997/02/12
Date: 1997-02-12T00:00:00+00:00	[thread overview]
Message-ID: <qw6afpa2hmt.fsf@esmeralda.enst.fr> (raw)
In-Reply-To: 5ds893$qgf@bs33n.staffs.ac.uk


>>>>> "Al" == Al Priest <cm3bcawp@bs47c.staffs.ac.uk> writes:

Al> I'm looking for a "nice" way to interface to the C accept
Al> function. Given it's clash with the reserved word accept, is there
Al> a good way to interface to the function? Currently the only way I
Al> can do it is by writing a C function to interface to the accept,
Al> and then interfacing to that in my Ada program.

I cannot see the point here. You can perfectly interface with C
functions which have the same name than an Ada keyword. You do not
*have to* give the same name than the C function, just use a third
parameter to the pragma Import to give the external name.

In your case, what you could do is:

  function C_Accept (<params>) return Interfaces.C.int;
  pragma Import (C, C_Accept, "accept");

Hope this helps.

  Sam
-- 
Samuel Tardieu -- sam@ada.eu.org




  reply	other threads:[~1997-02-12  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 [this message]
1997-02-13  0:00 ` Do-While Jones
1997-02-20  0:00   ` Samuel Mize
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