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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4c3f68493d9d2340,start X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!1g2000hsl.googlegroups.com!not-for-mail From: kug1977@web.de Newsgroups: comp.lang.ada Subject: Create a procedure with multiple arguments ... Date: Fri, 4 Jan 2008 12:28:24 -0800 (PST) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 89.54.124.144 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1199478504 7551 127.0.0.1 (4 Jan 2008 20:28:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 4 Jan 2008 20:28:24 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 1g2000hsl.googlegroups.com; posting-host=89.54.124.144; posting-account=3ciIaAoAAAA6pCfildcdAcuc3UQuirtL User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/523.12.1 (KHTML, like Gecko) Version/3.0.4 Safari/523.12.2,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:19201 Date: 2008-01-04T12:28:24-08:00 List-Id: Hi @ all, I'm a beginner in Ada and have the following problem: - I'm using GNAT 4.3 on a MacOS X 10.4. and develop on the OpenFirmware Interface. - To connect to the Firmware, the IEEE 1275 define an Procedure call- methode(), which can have up multiple arguments. IEEE 1275 define call- method as followed: IN: [string] method, ihandle, stack-arg1, ..., stack-argP OUT: catch-result, stack-result1, ..., stack-resultQ Pushes two less than N-args items, stack-arg1, ..., stack-argP, onto the Forth data stack, with stack-arg1 on top of the stack, and executes the package method named method in the instance ihandle as with $call-method, guarded by catch. Pops the result returned by catch into catch-result. If that result is nonzero, restore the depth of the Forth data stack to its depth prior to the execution of call-method. If that result is zero, pops up to one less than N-returns items, stack-result1, ..., stack-resultQ, from the Forth data stack into the returned values portion of the argument array, with stack-result1 corresponding to the top of the stack. N-args and N-returns are stored in the argument array and may be different for different calls to call-method. If the number of items X left on the Forth data stack as a result of the execution of method is less than N-returns, only stack-result1 ... stack-resultX are modified; other elements of the returned values portion of the argument array are unaffected. If X is more than N-returns, additional items are popped from the Forth data stack after setting stack- result1 ... stack-resultQ so that, in all cases, the execution of call- method results in no net change to the depth of the Forth data stack. In C, this is written as followed: static void *of_call(const char *service, int nargs, int nret, ...), but how can I write such a thing in Ada? Any help would be appreciated ... best regards Kay-Uwe