Debian Codegraph @

gcc/m2/gm2-compiler/Output.def

raw
1 (* Output.def redirect output.
2
3 Copyright (C) 2021-2025 Free Software Foundation, Inc.
4 Contributed by Gaius Mulley <[email protected]>.
5
6 This file is part of GNU Modula-2.
7
8 GNU Modula-2 is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
12
13 GNU Modula-2 is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU Modula-2; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. *)
21
22 DEFINITION MODULE Output ;
23
24 (*
25 Title : Output
26 Author : Gaius Mulley
27 System : GNU Modula-2
28 Date : Fri Jul 9 12:17:35 2021
29 Revision : $Version$
30 Description: provides an interface to output redirection for common
31 output procedures.
32 *)
33
34 FROM NameKey IMPORT Name ;
35 FROM DynamicStrings IMPORT String ;
36
37
38 (*
39 Open - attempt to open filename as the output file.
40 TRUE is returned if success, FALSE otherwise.
41 *)
42
43 PROCEDURE Open (filename: ARRAY OF CHAR) : BOOLEAN ;
44
45
46 (*
47 Close - close the output file.
48 *)
49
50 PROCEDURE Close ;
51
52
53 (*
54 Write - write a single character to the output file.
55 *)
56
57 PROCEDURE Write (ch: CHAR) ;
58
59
60 (*
61 WriteString - write an unformatted string to the output.
62 *)
63
64 PROCEDURE WriteString (s: ARRAY OF CHAR) ;
65
66
67 (*
68 KillWriteS - write a string to the output and free the string afterwards.
69 *)
70
71 PROCEDURE KillWriteS (s: String) ;
72
73
74 (*
75 WriteS - write a string to the output. The string is not freed.
76 *)
77
78 PROCEDURE WriteS (s: String) ;
79
80
81 (*
82 WriteKey - write a key to the output.
83 *)
84
85 PROCEDURE WriteKey (key: Name) ;
86
87
88 (*
89 WriteLn - write a newline to the output.
90 *)
91
92 PROCEDURE WriteLn ;
93
94
95 (*
96 WriteCard - write a cardinal using fieldlength characters.
97 *)
98
99 PROCEDURE WriteCard (card, fieldlength: CARDINAL) ;
100
101
102 (*
103 StartBuffer - create a buffer into which any output is redirected.
104 *)
105
106 PROCEDURE StartBuffer ;
107
108
109 (*
110 EndBuffer - end the redirection and return the contents of the buffer.
111 *)
112
113 PROCEDURE EndBuffer () : String ;
114
115
116 END Output.