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,8b0d028e57f221d4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-10 09:54:34 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!in.100proofnews.com!in.100proofnews.com!snoopy.risq.qc.ca!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Trying to import a C function References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Mon, 10 Nov 2003 12:39:54 -0500 NNTP-Posting-Host: 198.96.223.163 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1068485958 198.96.223.163 (Mon, 10 Nov 2003 12:39:18 EST) NNTP-Posting-Date: Mon, 10 Nov 2003 12:39:18 EST Organization: Bell Sympatico Xref: archiver1.google.com comp.lang.ada:2310 Date: 2003-11-10T12:39:54-05:00 List-Id: Preben Randhol wrote: > On 2003-11-06, Warren W. Gay VE3WWG wrote: > >>I find that it is generally easier, and more portable, to handle >>macros and size differences in a C wrapper function. This >>particularly applies to Linux, since so much changes there still. > > > Do you have a code example of this? Would be nice to see. > > Preben Download my APQ project (see home page below), and look at the process I used for adapting to MySQL. I run a combination of scripts, and compile small C programs to generate Ada spec packages from C macro constants. I also use a c_mysql.c module to interface between APQ.MySQL.Client.adb and MySQL's C libraries. This was necessary with MySQL, because some things in MySQL require you to work with structure pointers to members within. I didn't want to rely on structure padding and offsets not to change etc. There is a prominent link for APQ on my home page. Hope that helps, Warren. -- Warren W. Gay VE3WWG http://home.cogeco.ca/~ve3wwg