[comp.lang.ada] ada calling [C,FORTRAN] routines

cyrus@pprg.unm.edu (Tait Cyrus) (12/03/88)

I am sure this has been hashed around a lot, but I am VERY new to
this group, as well as knowing VERY little about ada.

I need to be able to call a C routine from ada.  The problem is
that I don't have the C source to this routine so I have to use
the existing file.o.  In addition, the calling sequence to this routine
has to be flexible enough to allow a variable number of args
as well as character string args that vary in length.  Below are
example calling sequences:
	my_exec( 1 )
	my_exec( 2, "file", 1 )
	my_exec( 3, buffer, len )
	my_exec( 4, buffer, len, 0 )
	.... etc

I could create different routines for each case:
	my_exec1()
	my_exec2( "file", 1 )
	my_exec3( buffer, len )
	my_exec4( buffer, len, 0 )
which would work, but how do I handle passing variable length character
strings.

Unfortunately, this project needs to be finished ASAP, so I can't speed
a lot of time RTFM, so I would appreciate ANY comments, suggestions on
places to look, recommendations on books to read, PD examples, flames.....

Thanks in advance

---
    @__________@    W. Tait Cyrus   (505) 277-0806
   /|         /|    University of New Mexico
  / |        / |    Dept of ECE - Parallel Processing Research Group
 @__|_______@  |    Albuquerque, New Mexico 87131
 |  |       |  |
 |  |  hc   |  |    e-mail:
 |  @.......|..@       cyrus@pprg.unm.edu
 | /        | /
 @/_________@/