]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/m2/pge-boot/GPushBackInput.h
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / pge-boot / GPushBackInput.h
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-2023 Free Software Foundation, Inc.
5 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
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 #include "config.h"
33 #include "system.h"
34 # ifdef __cplusplus
35 extern "C" {
36 # endif
37 # if !defined (PROC_D)
38 # define PROC_D
39 typedef void (*PROC_t) (void);
40 typedef struct { PROC_t proc; } PROC;
41 # endif
42
43 # include "GFIO.h"
44 # include "GDynamicStrings.h"
45
46 # if defined (_PushBackInput_C)
47 # define EXTERN
48 # else
49 # define EXTERN extern
50 # endif
51
52
53 /*
54 Open - opens a file for reading.
55 */
56
57 EXTERN FIO_File PushBackInput_Open (const char *a_, unsigned int _a_high);
58
59 /*
60 GetCh - gets a character from either the push back stack or
61 from file, f.
62 */
63
64 EXTERN char PushBackInput_GetCh (FIO_File f);
65
66 /*
67 PutCh - pushes a character onto the push back stack, it also
68 returns the character which has been pushed.
69 */
70
71 EXTERN char PushBackInput_PutCh (char ch);
72
73 /*
74 PutString - pushes a string onto the push back stack.
75 */
76
77 EXTERN void PushBackInput_PutString (const char *a_, unsigned int _a_high);
78
79 /*
80 PutStr - pushes a dynamic string onto the push back stack.
81 The string, s, is not deallocated.
82 */
83
84 EXTERN void PushBackInput_PutStr (DynamicStrings_String s);
85
86 /*
87 Error - emits an error message with the appropriate file, line combination.
88 */
89
90 EXTERN void PushBackInput_Error (const char *a_, unsigned int _a_high);
91
92 /*
93 WarnError - emits an error message with the appropriate file, line combination.
94 It does not terminate but when the program finishes an exit status of
95 1 will be issued.
96 */
97
98 EXTERN void PushBackInput_WarnError (const char *a_, unsigned int _a_high);
99
100 /*
101 WarnString - emits an error message with the appropriate file, line combination.
102 It does not terminate but when the program finishes an exit status of
103 1 will be issued.
104 */
105
106 EXTERN void PushBackInput_WarnString (DynamicStrings_String s);
107
108 /*
109 Close - closes the opened file.
110 */
111
112 EXTERN void PushBackInput_Close (FIO_File f);
113
114 /*
115 GetExitStatus - returns the exit status which will be 1 if any warnings were issued.
116 */
117
118 EXTERN unsigned int PushBackInput_GetExitStatus (void);
119
120 /*
121 SetDebug - sets the debug flag on or off.
122 */
123
124 EXTERN void PushBackInput_SetDebug (unsigned int d);
125
126 /*
127 GetColumnPosition - returns the column position of the current character.
128 */
129
130 EXTERN unsigned int PushBackInput_GetColumnPosition (void);
131
132 /*
133 GetCurrentLine - returns the current line number.
134 */
135
136 EXTERN unsigned int PushBackInput_GetCurrentLine (void);
137 # ifdef __cplusplus
138 }
139 # endif
140
141 # undef EXTERN
142 #endif