File : s-textio-zfp.ads
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME COMPONENTS --
4 -- --
5 -- S Y S T E M . T E X T _ I O --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 2011-2014, Free Software Foundation, Inc. --
10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
17 -- --
18 -- --
19 -- --
20 -- --
21 -- --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
26 -- --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
29 -- --
30 ------------------------------------------------------------------------------
31
32 -- This package defines the console I/O interface for the simplified version
33 -- of Ada.Text_IO used in ZFP runtimes or bare board platforms.
34
35 package System.Text_IO is
36 pragma Preelaborate;
37
38 -- The interface uses two subprograms for each direction: one for the ready
39 -- status and one for the action. This is done on purpose to avoid busy
40 -- waiting loops in the body.
41
42 procedure Initialize;
43 -- Must be called before all other subprograms to initialize the service.
44 -- We avoid the use of elaboration to make this package preelaborated.
45
46 Initialized : Boolean := False;
47 -- Set to True (by Initialize) when the service is initialized. Having this
48 -- variable outside allows reinitialization of the service.
49
50 --------------
51 -- Output --
52 --------------
53
54 function Is_Tx_Ready return Boolean;
55 -- Return True if it is possible to call Put. This function can be used for
56 -- checking that the output register of an UART is empty before write a
57 -- new character on it. For non blocking output system, this function can
58 -- always return True. Once this function has returned True, it must always
59 -- return True before the next call to Put.
60
61 procedure Put (C : Character);
62 -- Write a character on the console. Must be called only when Is_Tx_Ready
63 -- has returned True before, otherwise its behaviour is undefined.
64
65 function Use_Cr_Lf_For_New_Line return Boolean;
66 -- Return True if New_Line should output CR + LF, otherwise it will output
67 -- only LF.
68
69 -------------
70 -- Input --
71 -------------
72
73 function Is_Rx_Ready return Boolean;
74 -- Return True is a character can be read by Get. On systems where is it
75 -- difficult or impossible to know wether a character is available, this
76 -- function can always return True and Get will be blocking.
77
78 function Get return Character;
79 -- Read a character from the console. Must be called only when Is_Rx_Ready
80 -- has returned True, otherwise behaviour is undefined.
81 end System.Text_IO;