------------------------------------------------------------------------------ -- -- -- XVIEW ADA LIBRARY COMPONENTS -- -- -- -- XV_BASE_PACKAGE -- -- -- -- B o d y -- -- -- -- Copyright (c) 1995 Andreas Almroth, All Rights Reserved -- -- -- -- The XVIEW ADA library is free software; you can redistribute it and/or -- -- modify it under terms of the GNU Library General Public License as -- -- published by the Free Software Foundation; either version 2, or (at your -- -- option) any later version. The XVIEW ADA library is distributed in the -- -- hope that it will be useful, but WITHOUT ANY WARRANTY; without even the -- -- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- -- See the GNU Library General Public License for more details. -- -- You should have received a copy of the GNU Library General Public -- -- License along with the XVIEW ADA library; see the file COPYING.LIB. If -- -- not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, -- -- MA 02139, USA. -- -- -- ------------------------------------------------------------------------------ with Ada.Strings.Unbounded,Interfaces.C.Pointers; use Ada.Strings.Unbounded; package body xv_base_package is XV_INIT_ARGC_PTR_ARGV : constant := 1245708295; XV_INIT_ARGS : constant := 1241778178; XV_DISPLAY : constant := 1248725505; type char_array_ptr is access all Interfaces.C.char_array; type char_array_array is array (Integer range <>) of char_array_ptr; type char_array_array_ptr is access all char_array_array; procedure Initialize (V : in out Xv_Base) is procedure My_Xv_init (argc : Integer;argvs : System.address); pragma import (C,My_Xv_init,"my_xv_init"); Work : Unbounded_String; Term : String (1..1); begin Term(1) := Character'Val(0); Work := To_Unbounded_String(Command_Name) & To_Unbounded_String(Term); for I in 1..Argument_Count loop Work := Work & To_Unbounded_String(Argument(I)) & To_Unbounded_String(Term); end loop; My_Xv_init(Argument_Count + 1,Work'address); end Initialize; end xv_base_package;