summaryrefslogtreecommitdiff
path: root/shell/command_line_arguments.ads
blob: 4c54babc3e166579f45bb0b6ee513df111965fff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
with Interfaces.C;          use Interfaces.C;
with Interfaces.C.Strings;  use Interfaces.C.Strings;
with Interfaces.C.Pointers;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;

package Command_Line_Arguments is

   type Argument_Array is array (ptrdiff_t range <>) of aliased chars_ptr;

   package Argument_Vector_Package is new Pointers (
      Index => ptrdiff_t,
      Element => chars_ptr,
      Element_Array => Argument_Array,
      Default_Terminator => Null_Ptr
   );

   subtype Argument_Count_Type is ptrdiff_t;
   subtype Argument_Vector_Type is Argument_Vector_Package.Pointer;

   function Get_Argument(
      Argv   : in Argument_Vector_Type;
      Index  : Argument_Count_Type
   ) return String;

end Command_Line_Arguments;