comp.lang.ada
 help / color / mirror / Atom feed
From: "Matthew Heaney" <matthewjheaney@earthlink.net>
Subject: Re: Binding to C
Date: Sun, 27 Jul 2003 13:04:15 GMT
Date: 2003-07-27T13:04:15+00:00	[thread overview]
Message-ID: <j5QUa.622$mr1.354@newsread3.news.pas.earthlink.net> (raw)
In-Reply-To: MxXSa.2290$l63.28380@newsfep4-glfd.server.ntli.net

"chris" <spamoff.danx@ntlworld.com> wrote in message
news:MxXSa.2290$l63.28380@newsfep4-glfd.server.ntli.net...
>
> I came across the following in libjpeg... what should I map it to?
>
> const char* const* jpeg_message_table

This is a pointer to a constant array, comprising pointers to constant
strings.

You could use the types in Interfaces.C.*.  Here's another way to do it:

type char_array is array (Natural) of aliased Character;
pragma Convention (C, char_array);
pragma Suppress (Index_Check, On => char_array);

type const_char_ptr is access constant char_array;
for const_char'Storage_Size use 0;
pragma Convention (C, const_char_ptr);

type string_array is array (Natural) of aliased const_char_ptr;
pragma Convention (C, string_array);
pragma Suppress (Index_Check, On => string_array);

type const_string_ptr is access constant string_array;
for const_string_ptr'Storage_Size use 0;
pragma Convention (C, const_string_ptr);

JPEG_Message_Table : const_string_ptr;  -- voila!

-Matt





  parent reply	other threads:[~2003-07-27 13:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-21 18:59 Binding to C chris
2003-07-21 20:02 ` Martin Krischik
2003-07-22 17:12   ` chris
2003-07-23 13:47     ` Martin Krischik
2003-07-27 13:11     ` Matthew Heaney
2003-07-27 13:07   ` Matthew Heaney
2003-07-21 21:07 ` tmoran
2003-07-21 21:57   ` chris
2003-07-27 13:04 ` Matthew Heaney [this message]
2003-07-28 20:52 ` Freejack
2003-07-29 19:21   ` chris
2003-08-09 11:29 ` Patrice Freydiere
2003-08-09 13:09   ` Jeffrey Creem
2003-08-09 13:54     ` Patrice Freydiere
2003-08-11 23:49   ` chris
2003-08-12  6:40     ` Patrice Freydiere
2003-08-12 11:58       ` chris
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox