File : a-textio-zfp.adb
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME COMPONENTS --
4 -- --
5 -- A D A . T E X T _ I O --
6 -- --
7 -- B o d y --
8 -- --
9 -- Copyright (C) 1992-2011, 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 -- Version for use with zero foot print run time
33
34 with System.Text_IO; use System.Text_IO;
35
36 package body Ada.Text_IO is
37
38 ---------
39 -- Get --
40 ---------
41
42 procedure Get (C : out Character) is
43 begin
44 while not Is_Rx_Ready loop
45 null;
46 end loop;
47
48 C := System.Text_IO.Get;
49 end Get;
50
51 --------------
52 -- New_Line --
53 --------------
54
55 procedure New_Line is
56 begin
57 if Use_Cr_Lf_For_New_Line then
58 Put (ASCII.CR);
59 end if;
60
61 Put (ASCII.LF);
62 end New_Line;
63
64 ---------
65 -- Put --
66 ---------
67
68 procedure Put (Item : Character) is
69 begin
70 while not Is_Tx_Ready loop
71 null;
72 end loop;
73
74 System.Text_IO.Put (Item);
75 end Put;
76
77 procedure Put (Item : String) is
78 begin
79 for J in Item'Range loop
80 Put (Item (J));
81 end loop;
82 end Put;
83
84 --------------
85 -- Put_Line --
86 --------------
87
88 procedure Put_Line (Item : String) is
89 begin
90 Put (Item);
91 New_Line;
92 end Put_Line;
93
94 begin
95 if not Initialized then
96 Initialize;
97 end if;
98 end Ada.Text_IO;