1 ------------------------------------------------------------------------------
3 -- GNAT ncurses Binding --
5 -- Terminal_Interface.Curses.Forms.Form_User_Data --
11 -- The ncurses Ada95 binding is copyrighted 1996 by --
12 -- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de --
14 -- Permission is hereby granted to reproduce and distribute this --
15 -- binding by any means and for any fee, whether alone or as part --
16 -- of a larger distribution, in source or in binary form, PROVIDED --
17 -- this notice is included with any such distribution, and is not --
18 -- removed from any of its header files. Mention of ncurses and the --
19 -- author of this binding in any applications linked with it is --
20 -- highly appreciated. --
22 -- This binding comes AS IS with no warranty, implied or expressed. --
23 ------------------------------------------------------------------------------
26 ------------------------------------------------------------------------------
27 with Unchecked_Conversion;
29 -- |=====================================================================
30 -- | man page form__userptr.3x
31 -- |=====================================================================
33 package body Terminal_Interface.Curses.Forms.Form_User_Data is
35 function To_Address is new Unchecked_Conversion (User_Access,
37 function To_Pointer is new Unchecked_Conversion (System.Address,
42 procedure Set_User_Data (Frm : in Form;
43 Data : in User_Access)
45 A : constant Form_User_Wrapper_Access := Form_Userptr (Frm);
50 A.U := To_Address (Data);
56 procedure Get_User_Data (Frm : in Form;
57 Data : out User_Access)
59 A : constant Form_User_Wrapper_Access := Form_Userptr (Frm);
64 Data := To_Pointer (A.U);
68 end Terminal_Interface.Curses.Forms.Form_User_Data;