4.2.35. GNATCOLL.OS.Process_Types (win32)

package GNATCOLL.OS.Process_Types is

   package UTF8 renames Ada.Strings.UTF_Encoding;
   package OS renames GNATCOLL.OS;

   --  Win32 process handle
   type Process_Handle is new OS.Win32.HANDLE;
   Invalid_Handle : constant Process_Handle;

   -------------------------
   -- Process Environment --
   -------------------------

   type Environ is limited private;
   --  Represent environment passed to a child process

   Case_Sensitive_Env_Var_Names : constant Boolean := False;

   procedure Inherit (Env : in out Environ);
   --  Call inherit to force parent process environment inheritance. When
   --  calling Inherit, all previous call to Set_Variable and/or Import are
   --  ignored.

   procedure Import (Env : in out Environ);
   --  Import current process environment into Env. Env can then be modified
   --  using Set_Variable.

   procedure Set_Variable
      (Env   : in out Environ;
       Name  : UTF8.UTF_8_String;
       Value : UTF8.UTF_8_String);
   --  Set variable Name to Value in Env

   function As_C (Env : Environ) return OS.C_WString;
   --  Export Env as a concatenation of null terminated wchar string followed
   --  by two wchar null characters. Each element is of the form "name=value"

   procedure Deallocate (Env : in out Environ);
   --  Deallocate Environ.

   -----------------------
   -- Process arguments --
   -----------------------

   type Arguments is limited private;
   --  Add an argument Arg to Args

   procedure Add_Argument
      (Args : in out Arguments;
       Arg  : UTF8.UTF_8_String);
   --  Add an argument Arg to Args

   function As_C (Args : Arguments) return OS.C_WString;
   --  Export Arguments as a null terminated wchar string

   procedure Deallocate (Args : in out Arguments);
   --  Deallocate Args

end GNATCOLL.OS.Process_Types;