File : s-textio-xtratum.adb
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME COMPONENTS --
4 -- --
5 -- S Y S T E M . T E X T _ I O --
6 -- --
7 -- B o d y --
8 -- --
9 -- Copyright (C) 2012-2013, 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 -- Minimal version of Text_IO body for use on XtratuM
33
34 package body System.Text_IO is
35
36 ---------
37 -- Get --
38 ---------
39
40 function Get return Character is
41 begin
42 -- XtratuM no longer supports reading from the console
43
44 raise Program_Error;
45 return ASCII.NUL;
46 end Get;
47
48 ----------------
49 -- Initialize --
50 ----------------
51
52 procedure Initialize is
53 begin
54 Initialized := True;
55 end Initialize;
56
57 -----------------
58 -- Is_Rx_Ready --
59 -----------------
60
61 function Is_Rx_Ready return Boolean is
62 begin
63 return False;
64 end Is_Rx_Ready;
65
66 -----------------
67 -- Is_Tx_Ready --
68 -----------------
69
70 function Is_Tx_Ready return Boolean is
71 begin
72 return True;
73 end Is_Tx_Ready;
74
75 ---------
76 -- Put --
77 ---------
78
79 procedure Put (C : Character) is
80 procedure XtratuM_Write (Addr : System.Address; Length : Integer);
81 pragma Import (C, XtratuM_Write, "XM_write_console");
82 begin
83 XtratuM_Write (C'Address, 1);
84 end Put;
85
86 ----------------------------
87 -- Use_Cr_Lf_For_New_Line --
88 ----------------------------
89
90 function Use_Cr_Lf_For_New_Line return Boolean is
91 begin
92 return False;
93 end Use_Cr_Lf_For_New_Line;
94
95 end System.Text_IO;