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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,130283ad9c6c2e69 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-13 11:06:34 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!howland.reston.ans.net!EU.net!julienas!donald!geant!news From: courtel@cenatls.cena.dgac.fr (Nicolas Courtel) Subject: Re: Interfacing Ada to Unix/execl var. arg. list function? In-Reply-To: Dale Stanbrough's message of 13 Oct 1994 07:44:37 GMT Message-ID: <1994Oct13.133144.17088@cenatls.cena.dgac.fr> Sender: news@cenatls.cena.dgac.fr Organization: Centre d'Etudes de la Navigation Aerienne, Toulouse, France References: <37ioh5$h9v@goanna.cs.rmit.oz.au> Date: Thu, 13 Oct 1994 13:31:38 GMT Date: 1994-10-13T13:31:38+00:00 List-Id: >>>>> On 13 Oct 1994 07:44:37 GMT, Dale Stanbrough said: |> I am currently trying to develop a simple Ada/Unix binding (not Posix!) |> that will allow students to use the packages with a minimum of fuss. |> (i.e. reading the Unix man page/Unix programming text would give them |> a fair idea of how to use the Ada version). I have written such a binding some time ago : it's called Paradise, is free software, and you can get it from ftp.cenatls.cena.dgac.fr, in pub/export. It has not been ported for Gnat yet, but I plan to do so when I have some time. |> I've got stuck on how to implement Ada calls to the corresponding |> variable parameter list C functions, specifically execl. Here's the specification of Paradise's execv call (as execl requires a variable number of parameters, I have found no clean binding to it): type PARAMETER is access STRING; type PARAMETER_ARRAY is array (NATURAL range <>) of PARAMETER; procedure EXECV (PATH: in STRING; ARGV: in PARAMETER_ARRAY); An ASCII.nul suffix is added to all the strings in the body, and the C execv is very happy with them. For those who are interested, here's the README of Paradise: -- Paradise is a set of Ada packages intended to provide an interface to the Unix operating system, and more specifically to the communication routines, that are accessed via file descriptors. It lets the Ada programmer use files, pipes, and sockets, as well as signals, error codes, environment variables, etc..., using an interface that looks as much as possible like the C interface. Paradise supports multi-tasking: any input or output is blocking for the calling task only, and not for the entire process. Paradise is intended to be system-independant and compiler-independant; so far, it works on four environments: - SunOS 4.1 (Sparc) and SunAda (Verdix 6.1) compiler - SunOS 4.1 (Sparc) and TeleSoft 4.1.1 compiler - HP-UX (HP9000/700) and HP-Ada (Alsys) compiler - HP-UX (HP9000/700) and Verdix 6.3d compiler It is known not to work well on SunOS/Alsys, because of problems on signal handlers; For people who would like to port it to other environments, informations on portability are displayed inside the code. A programmer's guide should appear in future versions. Send all comments, bug reports, patches to "paradise@cenatls.cena.dgac.fr" Nicolas Courtel - December 1993 -- Nicolas Courtel - courtel@dgac.fr >>> Inside every large program <<< >>> is a small program struggling to get out <<<