Debian Codegraph @

gcc/m2/pge-boot/GPushBackInput.h

raw
1 /* do not edit automatically generated by mc from PushBackInput. */
2 /* PushBackInput.def provides a method for pushing back and consuming input.
3
4 Copyright (C) 2001-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 Under Section 7 of GPL version 3, you are granted additional
20 permissions described in the GCC Runtime Library Exception, version
21 3.1, as published by the Free Software Foundation.
22
23 You should have received a copy of the GNU General Public License and
24 a copy of the GCC Runtime Library Exception along with this program;
25 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
26 <http://www.gnu.org/licenses/>. */
27
28
29 #if !defined (_PushBackInput_H)
30 # define _PushBackInput_H
31
32 # ifdef __cplusplus
33 extern "C" {
34 # endif
35 #include <stdbool.h>
36 # if !defined (PROC_D)
37 # define PROC_D
38 typedef void (*PROC_t) (void);
39 typedef struct { PROC_t proc; } PROC;
40 # endif
41
42 # include "GFIO.h"
43 # include "GDynamicStrings.h"
44
45 # if defined (_PushBackInput_C)
46 # define EXTERN
47 # else
48 # define EXTERN extern
49 # endif
50
51
52 /*
53 Open - opens a file for reading.
54 */
55
56 EXTERN FIO_File PushBackInput_Open (const char *a_, unsigned int _a_high);
57
58 /*
59 GetCh - gets a character from either the push back stack or
60 from file, f.
61 */
62
63 EXTERN char PushBackInput_GetCh (FIO_File f);
64
65 /*
66 PutCh - pushes a character onto the push back stack, it also
67 returns the character which has been pushed.
68 */
69
70 EXTERN char PushBackInput_PutCh (char ch);
71
72 /*
73 PutString - pushes a string onto the push back stack.
74 */
75
76 EXTERN void PushBackInput_PutString (const char *a_, unsigned int _a_high);
77
78 /*
79 PutStr - pushes a dynamic string onto the push back stack.
80 The string, s, is not deallocated.
81 */
82
83 EXTERN void PushBackInput_PutStr (DynamicStrings_String s);
84
85 /*
86 Error - emits an error message with the appropriate file, line combination.
87 */
88
89 EXTERN void PushBackInput_Error (const char *a_, unsigned int _a_high);
90
91 /*
92 WarnError - emits an error message with the appropriate file, line combination.
93 It does not terminate but when the program finishes an exit status of
94 1 will be issued.
95 */
96
97 EXTERN void PushBackInput_WarnError (const char *a_, unsigned int _a_high);
98
99 /*
100 WarnString - emits an error message with the appropriate file, line combination.
101 It does not terminate but when the program finishes an exit status of
102 1 will be issued.
103 */
104
105 EXTERN void PushBackInput_WarnString (DynamicStrings_String s);
106
107 /*
108 Close - closes the opened file.
109 */
110
111 EXTERN void PushBackInput_Close (FIO_File f);
112
113 /*
114 GetExitStatus - returns the exit status which will be 1 if any warnings were issued.
115 */
116
117 EXTERN unsigned int PushBackInput_GetExitStatus (void);
118
119 /*
120 SetDebug - sets the debug flag on or off.
121 */
122
123 EXTERN void PushBackInput_SetDebug (bool d);
124
125 /*
126 GetColumnPosition - returns the column position of the current character.
127 */
128
129 EXTERN unsigned int PushBackInput_GetColumnPosition (void);
130
131 /*
132 GetCurrentLine - returns the current line number.
133 */
134
135 EXTERN unsigned int PushBackInput_GetCurrentLine (void);
136 # ifdef __cplusplus
137 }
138 # endif
139
140 # undef EXTERN
141 #endif