-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
--- Author: Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> 1996
+-- Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1996
-- Version Control:
--- $Revision: 1.8 $
--- Binding Version 00.93
+-- $Revision: 1.12 $
+-- Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
with Ada.Unchecked_Deallocation;
with Ada.Unchecked_Conversion;
-with Terminal_Interface.Curses.Forms.Field_Types.User;
-with Terminal_Interface.Curses.Forms.Field_Types.User.Choice;
-- |
-- |=====================================================================
-- | man page form_fieldtype.3x
function Make_Arg (Args : System.Address) return System.Address
is
- function Getarg (Arg : System.Address := Args)
- return System.Address;
- pragma Import (C, Getarg, "_nc_ada_getvarg");
+ -- Actually args is a double indirected pointer to the arguments
+ -- of a C variable argument list. In theory it is now quite
+ -- complicated to write portable routine that reads the arguments,
+ -- because one has to know the growth direction of the stack and
+ -- the sizes of the individual arguments.
+ -- Fortunately we are only interested in the first argument (#0),
+ -- we know its size and for the first arg we don't care about
+ -- into which stack direction we have to proceed. We simply
+ -- resolve the double indirection and thats it.
+ type V is access all System.Address;
+ function To_Access is new Ada.Unchecked_Conversion (System.Address,
+ V);
begin
- return Getarg;
+ return To_Access (To_Access (Args).all).all;
end Make_Arg;
function Copy_Arg (Usr : System.Address) return System.Address