Debian Codegraph @

gcc/m2/pge-boot/GOutput.h

raw
1 /* do not edit automatically generated by mc from Output. */
2 /* Output.def redirect output.
3
4 Copyright (C) 2021-2025 Free Software Foundation, Inc.
5 Contributed by Gaius Mulley <[email protected]>.
6
7 This file is part of GNU Modula-2.
8
9 GNU Modula-2 is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
12 any later version.
13
14 GNU Modula-2 is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with GNU Modula-2; see the file COPYING3. If not see
21 <http://www.gnu.org/licenses/>. */
22
23
24 #if !defined (_Output_H)
25 # define _Output_H
26
27 # ifdef __cplusplus
28 extern "C" {
29 # endif
30 #include <stdbool.h>
31 # if !defined (PROC_D)
32 # define PROC_D
33 typedef void (*PROC_t) (void);
34 typedef struct { PROC_t proc; } PROC;
35 # endif
36
37 # include "GNameKey.h"
38 # include "GDynamicStrings.h"
39
40 # if defined (_Output_C)
41 # define EXTERN
42 # else
43 # define EXTERN extern
44 # endif
45
46
47 /*
48 Open - attempt to open filename as the output file.
49 TRUE is returned if success, FALSE otherwise.
50 */
51
52 EXTERN bool Output_Open (const char *filename_, unsigned int _filename_high);
53
54 /*
55 Close - close the output file.
56 */
57
58 EXTERN void Output_Close (void);
59
60 /*
61 Write - write a single character to the output file.
62 */
63
64 EXTERN void Output_Write (char ch);
65
66 /*
67 WriteString - write an unformatted string to the output.
68 */
69
70 EXTERN void Output_WriteString (const char *s_, unsigned int _s_high);
71
72 /*
73 KillWriteS - write a string to the output and free the string afterwards.
74 */
75
76 EXTERN void Output_KillWriteS (DynamicStrings_String s);
77
78 /*
79 WriteS - write a string to the output. The string is not freed.
80 */
81
82 EXTERN void Output_WriteS (DynamicStrings_String s);
83
84 /*
85 WriteKey - write a key to the output.
86 */
87
88 EXTERN void Output_WriteKey (NameKey_Name key);
89
90 /*
91 WriteLn - write a newline to the output.
92 */
93
94 EXTERN void Output_WriteLn (void);
95
96 /*
97 WriteCard - write a cardinal using fieldlength characters.
98 */
99
100 EXTERN void Output_WriteCard (unsigned int card, unsigned int fieldlength);
101
102 /*
103 StartBuffer - create a buffer into which any output is redirected.
104 */
105
106 EXTERN void Output_StartBuffer (void);
107
108 /*
109 EndBuffer - end the redirection and return the contents of the buffer.
110 */
111
112 EXTERN DynamicStrings_String Output_EndBuffer (void);
113 # ifdef __cplusplus
114 }
115 # endif
116
117 # undef EXTERN
118 #endif