Re: What is the best way to define the Imported C function



qunying wrote:

Hi,

I am learning Ada and try to test the interface with C.

for this function, what is the best way to define the function in Ada?

int xcb_parse_display(const char *name, char **host, int *display, int
*screen);

function parse_display (
Name : in Interfaces.C.Strings.char_array_access;
Host : access Interfaces.C.Strings.char_array_access;
Display : access Interfaces.C.int;
Screen : access Interfaces.C.int)
return Interfaces.C.int;

See:

http://www.adaic.com/standards/05rm/html/RM-B-3.html

Martin

--
mailto://krischik@xxxxxxxxxxxxxxxxxxxxx
Ada programming at: http://ada.krischik.com
.



Relevant Pages

  • Re: For the AdaOS folks
    ... API that says create/delete an integer? ... >>as an Ada binding, I can do another registry query and get the ... libraries can strengthen the typing of the Ada interface. ...
    (comp.lang.ada)
  • Re: Ada DB bindings and APQ
    ... > seems like unnecessary indirection and complexity - what ... The only way Ada might help ... Sybase interface is a low-level one. ... >> connection before a query that depends on it etc. ...
    (comp.lang.ada)
  • Re: Generic Package
    ... addresses and refer to addresses in a consistent way. ... (I'll listen to Randy who said: "In any case, this is an Ada forum, ... an interface for expressing all preconditions, ... all orderings are ordered but some orderings are more ordered than ...
    (comp.lang.ada)
  • Using A# & MSIL2Ada ...
    ... I'm trying to write a DLL for one of my .NET-projects. ... implement a C# interface in Ada, and then use that new Ada type from ... interface takes a parameter of type ... ... its ancestor being ClassA in DLL1.dll. ...
    (comp.lang.ada)
  • Re: Arguments for single-mutex-exclusion on protected types (Was: Does Ada tasking profit fr
    ... They're Ada 95, and have been compiled with at least 2 different ... Only the client can know that, ... It complicates the interface; it makes the client worry about something ... It doesn't work for a protected interface (no discriminants); ...
    (comp.lang.ada)