]>
Commit | Line | Data |
---|---|---|
38cbfe40 RK |
1 | ------------------------------------------------------------------------------ |
2 | -- -- | |
3 | -- GNAT COMPILER COMPONENTS -- | |
4 | -- -- | |
5 | -- L I B . U T I L -- | |
6 | -- -- | |
7 | -- B o d y -- | |
8 | -- -- | |
1d005acc | 9 | -- Copyright (C) 1992-2019, Free Software Foundation, Inc. -- |
38cbfe40 RK |
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- -- | |
b5c84c3c | 13 | -- ware Foundation; either version 3, or (at your option) any later ver- -- |
38cbfe40 RK |
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. See the GNU General Public License -- | |
17 | -- for more details. You should have received a copy of the GNU General -- | |
b5c84c3c RD |
18 | -- Public License distributed with GNAT; see file COPYING3. If not, go to -- |
19 | -- http://www.gnu.org/licenses for a complete copy of the license. -- | |
38cbfe40 RK |
20 | -- -- |
21 | -- GNAT was originally developed by the GNAT team at New York University. -- | |
71ff80dc | 22 | -- Extensive contributions were provided by Ada Core Technologies Inc. -- |
38cbfe40 RK |
23 | -- -- |
24 | ------------------------------------------------------------------------------ | |
25 | ||
7eaa7cdf RD |
26 | with Uintp; use Uintp; |
27 | ||
38cbfe40 RK |
28 | package Lib.Util is |
29 | ||
30 | -- This package implements a buffered write of library information | |
31 | ||
32 | procedure Write_Info_Char (C : Character); | |
33 | pragma Inline (Write_Info_Char); | |
34 | -- Adds one character to the info | |
35 | ||
36 | procedure Write_Info_Char_Code (Code : Char_Code); | |
37 | -- Write a single character code. Upper half values in the range | |
38 | -- 16#80..16#FF are written as Uhh (hh = 2 hex digits), and values | |
39 | -- greater than 16#FF are written as Whhhh (hhhh = 4 hex digits). | |
40 | ||
41 | function Write_Info_Col return Positive; | |
42 | -- Returns the column in which the next character will be written | |
43 | ||
44 | procedure Write_Info_EOL; | |
45 | -- Terminate current info line. This only flushes the buffer | |
46 | -- if there is not enough room for another complete line or | |
47 | -- if the host system needs a write for each line. | |
48 | ||
49 | procedure Write_Info_Initiate (Key : Character); | |
f7f0159d AC |
50 | -- Initiates write of new line to info file, the parameter is the keyword |
51 | -- character for the line. The caller is responsible for writing the | |
52 | -- required blank after the key character if needed. | |
38cbfe40 RK |
53 | |
54 | procedure Write_Info_Nat (N : Nat); | |
55 | -- Adds image of N to Info_Buffer with no leading or trailing blanks | |
56 | ||
7eaa7cdf RD |
57 | procedure Write_Info_Int (N : Int); |
58 | -- Adds image of N to Info_Buffer with no leading or trailing blanks. A | |
59 | -- minus sign is prepended for negative values. | |
60 | ||
38cbfe40 | 61 | procedure Write_Info_Name (Name : Name_Id); |
39f4e199 VC |
62 | procedure Write_Info_Name (Name : File_Name_Type); |
63 | procedure Write_Info_Name (Name : Unit_Name_Type); | |
64 | -- Adds characters of Name to Info_Buffer. Note that in all cases, the | |
65 | -- name is written literally from the names table entry without modifying | |
66 | -- the case, using simply Get_Name_String. | |
38cbfe40 | 67 | |
e4691ba9 AC |
68 | procedure Write_Info_Name_May_Be_Quoted (Name : File_Name_Type); |
69 | -- Similar to Write_Info_Name, but if Name includes spaces, then it is | |
70 | -- quoted and the '"' are doubled. | |
71 | ||
7eaa7cdf RD |
72 | procedure Write_Info_Slit (S : String_Id); |
73 | -- Write string literal value in format required for L/N lines in ali file | |
74 | ||
38cbfe40 RK |
75 | procedure Write_Info_Str (Val : String); |
76 | -- Adds characters of Val to Info_Buffer surrounded by quotes | |
77 | ||
78 | procedure Write_Info_Tab (Col : Positive); | |
79 | -- Tab out with blanks and HT's to column Col. If already at or past | |
80 | -- Col, writes a single blank, so that we do get a required field | |
81 | -- separation. | |
82 | ||
83 | procedure Write_Info_Terminate; | |
84 | -- Terminate current info line and output lines built in Info_Buffer | |
85 | ||
7eaa7cdf RD |
86 | procedure Write_Info_Uint (N : Uint); |
87 | -- Adds decimal image of N to Info_Buffer with no leading or trailing | |
88 | -- blanks. A minus sign is prepended for negative values. | |
89 | ||
38cbfe40 | 90 | end Lib.Util; |