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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6c08e49fe17c9eeb X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Help - Call C function (with out parameter) from ADA95 Date: 1996/10/11 Message-ID: #1/1 X-Deja-AN: 188799435 references: <01bbb779$7d989ca0$0e39e382@caeepc1.cri.dk> organization: New York University newsgroups: comp.lang.ada Date: 1996-10-11T00:00:00+00:00 List-Id: Mikael asks "Does anyone know how to call a C function with out a parameter from ADA95. As far as I know ADA is only allowing in parameters to functions. The C function also has a return value so I can't declare as a procedure. Any help would be appreciated Thanks in advance." You can model it as an access parameter on the Ada side, either using an explicit access type, or, if null is not a possible value, using an access parameter. Another possibility if you are using GNAT version 3.07 or later, is to use the pragma Import_Valued_Procedure, which is exactly intended for this case, and allows a subprogram that is externally a function to be modeled as a procedure with an extra out parameter. P.S. The 3.07 sources are now frozen, so the public release of 3.07 for at least some targets should occur fairly soon now. Note that 3.06 was skipped (it was the version on an SGI prerelease).