From: tmoran@acm.org
Subject: Interfacing to C: API with macros
Date: Tue, 12 Jun 2007 19:18:55 -0500
Date: 2007-06-12T19:18:55-05:00 [thread overview]
Message-ID: <yqCdnbl2p7VyqvLbnZ2dnUVZ_qSrnZ2d@comcast.com> (raw)
In-Reply-To: 1181679449.352274.217590@g37g2000prf.googlegroups.com
> Again, the straightforward solution: thin wrapper in C, that itself is
> simple enough to be easily imported by Ada code.
>
> Again: is this THE solution?
>
> Looks like in order to write any nontrivial system software the poor
> Ada programmer has to start with an awful lots of wrappers - where is
> maintainability and productivity when you need them? ;-)
If you are interfacing to something that isn't documented, then you
will indeed have to experimentally determine the interface, or make
a wrapper from unknown to known interface spec.
Usually the interface is documented (though too often erroneously),
though you may have to look carefully to see, for instance, what some
bit-field packing macro is doing. Once you know, you can write a
direct Ada interface. Claw, for instance, uses a great number of Windows
API calls, and it uses no wrappers in C (though the whole point of Claw
is to give an Ada-flavor wrapper to the Windows API). Many APIs
in the Windows world also have typelib descriptions that can be used
to automatically generate an Ada wrapper.
next prev parent reply other threads:[~2007-06-13 0:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-12 20:17 Interfacing to C: API with macros Maciej Sobczak
2007-06-12 20:25 ` Lutz Donnerhacke
2007-06-13 0:18 ` tmoran [this message]
2007-06-13 14:06 ` Steve
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox