comp.lang.ada
 help / color / mirror / Atom feed
From: David Gressett <gressett@iglobal.net>
Subject: Another Newbie question about interfacing to C
Date: 2000/06/01
Date: 2000-06-01T00:00:00+00:00	[thread overview]
Message-ID: <okrdjsk4klohs5gv3890nbk5ee7199tbnm@4ax.com> (raw)

I need to communucate with a C routine that takes an array of char *
as an argument, i.e., it is prototyped as

void someroutine(char *things[]);

The problem is that the component elements of  things are not
necessarily pointers to char;  they could be pointers to something
else that have been cast to pointers to char. someroutine has access
to information that tells it exactly which type is pointed to by the
elements of things[].

The original programmer of this routine used this technique to pass
arguments of arbitrary type to the routine someroutine. The types are
known at compile time, and their order in things[] is significant.The
number of elements in things[] is unlimited.

Is there a reasonable Ada way to pass arguments of arbitrary type to
an Ada routine? It need not look very C-ish. 




             reply	other threads:[~2000-06-01  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-01  0:00 David Gressett [this message]
2000-06-01  0:00 ` Another Newbie question about interfacing to C gressett
2000-06-02  0:00   ` Marin D. Condic
replies disabled

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