From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d71460587da14d5b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-31 02:30:06 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!newsfeed.mathworks.com!nntp.abs.net!lore.csc.com!baen1673807.greenlnk.net!baen1673807!not-for-mail From: "Martin Dowie" Newsgroups: comp.lang.ada Subject: Re: Importing C structs? Date: Thu, 31 Jul 2003 10:27:15 +0100 Organization: BAE SYSTEMS Message-ID: <3f28e075$1@baen1673807.greenlnk.net> References: <1V1Wa.299$jp.55@newsread4.news.pas.earthlink.net> NNTP-Posting-Host: 20.44.240.4 X-Trace: lore.csc.com 1059643675 735 20.44.240.4 (31 Jul 2003 09:27:55 GMT) X-Complaints-To: abuse@news.csc.com NNTP-Posting-Date: Thu, 31 Jul 2003 09:27:55 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Original-NNTP-Posting-Host: glkc1363740.sd.edinbr.gmav.gecm.com X-Original-Trace: 31 Jul 2003 10:25:09 +0100, glkc1363740.sd.edinbr.gmav.gecm.com Xref: archiver1.google.com comp.lang.ada:41063 Date: 2003-07-31T10:27:15+01:00 List-Id: "Freejack" wrote in message news:pan.2003.07.31.07.52.36.94842.845@nospam.net... > So I'm assuming I could just use an Ada enumerated type. (It compiles when I > do this, but it fails at runtime.) Note that the first underlying value is '1' not '0' and you should still add a 'pragma Convention' to it. > The second hurdle I'll need to jump is creating a suitable Ada > replacement for this buttload of defines that occur after the DBTYPE > declaration. > > /* > * DB access method and cursor operation values. Each value is an operation > * code to which additional bit flags are added. > */ > #define DB_AFTER 1 /* c_put() */ [snip] > #define DB_WRITELOCK 34 /* cursor() (internal) */ > > But one step at a time. > > Hooking into glibc is cake, but this is something else entirely. Heh. > > Any suggestions? Get a C->Ada converter! c2ada springs to mind http://www.averstar.com/~stt/bindings/c2ada/c2ada.html