summaryrefslogtreecommitdiff
path: root/shell/rtems_shell.ads
blob: 8f7b5d6739bdbf4003f104daa75ddb71b1a836b0 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--
--  $Id$
--

with Interfaces.C;          use Interfaces.C;
with Interfaces.C.Strings;  use Interfaces.C.Strings;
with Interfaces.C.Pointers;

package RTEMS_Shell 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;

   type Command_Function_Type is access function (ArgC : Argument_Count_Type;
      ArgV : Argument_Vector_Type) return int;
   pragma Convention (C, Command_Function_Type);

   procedure RTEMS_Shell_Add_Command(Name : chars_ptr; Category : chars_ptr;
      Help : chars_ptr; Command_Function : Command_Function_Type);
   pragma Import (C, RTEMS_Shell_Add_Command, "rtems_shell_add_cmd");

   type Prompt_Function_Type is access function return chars_ptr;
   pragma Convention (C, Prompt_Function_Type);

   procedure Set_RTEMS_Shell_Prompt_Function(
      Prompt_Function : Prompt_Function_Type);
   pragma Import (C, Set_RTEMS_Shell_Prompt_Function, "set_prompt_function");

   procedure Invoke_RTEMS_Shell;
   pragma Import (C, Invoke_RTEMS_Shell, "invoke_rtems_shell");

   procedure Initialize_Telnet_Daemon;
   pragma Import (C, Initialize_Telnet_Daemon, "init_telnet_daemon");

end RTEMS_Shell;