comp.lang.ada
 help / color / mirror / Atom feed
From: axtens <Bruce.Axtens@gmail.com>
Subject: Re: Variable list parameters
Date: Wed, 28 Nov 2007 00:48:44 -0800 (PST)
Date: 2007-11-28T00:48:44-08:00	[thread overview]
Message-ID: <bab14547-6f74-4da7-901c-da133a832a08@e25g2000prg.googlegroups.com> (raw)
In-Reply-To: wccprxwsugc.fsf@shell01.TheWorld.com

Newbie says, "What about Stdarg.Impl?"

-- $Source: /user/cp_source/ObjectAda/rts/bindings/win32ada/stdarg/
impl.ads,v $
-- $Revision: 1.1 $ $Date: 2001/01/09 19:05:19 $ $Author: shancher $

with Interfaces.C.Pointers;

package Stdarg.Impl is

    -- *******************************************************
    -- Getting arguments out of lists, for use by implementers
    -- of variable-parameter functions
    -- *******************************************************

    subtype Int is Interfaces.C.Int;

    type Param_Access is private;

    function Address_of_First_Arg (Args: ArgList) return Param_Access;

    function Address_of_Vararg_List (Args: ArgList) return
Param_Access;

    function ArgCount (Args: ArgList) return Int;

    function "&" (Left, Right: ArgList) return ArgList;

    procedure Do_Varargs (Proc     : in System.Address;
                          Nb_Args  : Int;
                          Arg_Addr : Param_Access);

    function F_Varargs (Func     : in System.Address;
                        Nb_Args  : Int;
                        Arg_Addr : Param_Access) return
Stdarg.C_Param;

    -- debugging
    -- procedure Dump(Addr: Param_Access; Nb_Args  : Stdarg.Int);
    -- pragma Import(C, Dump, "dump");

private

    package Arith is new Interfaces.C.Pointers(
	Integer, C_Param, Stdarg.ArgVector, 0);

    type Param_Access is new Arith.Pointer;

    pragma Import(C, Do_Varargs, "do_varargs");
    pragma Import(C, F_Varargs, "do_varargs");

-------------------------------------------------------------------------------
--
-- THIS FILE AND ANY ASSOCIATED DOCUMENTATION IS FURNISHED "AS IS"
WITHOUT
-- WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED
-- TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR
-- PURPOSE.  The user assumes the entire risk as to the accuracy and
the
-- use of this file.
--
-- Copyright (c) Intermetrics, Inc. 1995
-- Royalty-free, unlimited, worldwide, non-exclusive use,
modification,
-- reproduction and further distribution of this file is permitted.
--
-------------------------------------------------------------------------------


end Stdarg.Impl;


Kind regards,
Bruce.



  reply	other threads:[~2007-11-28  8:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-26 15:44 Variable list parameters shaunpatterson
2007-11-26 16:52 ` Steve
2007-11-26 18:44   ` tmoran
2007-11-26 19:00   ` Robert A Duff
2007-11-28  8:48     ` axtens [this message]
2007-11-28 20:21       ` amado.alves
replies disabled

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