]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/m2/mc-boot/GPushBackInput.h
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / mc-boot / GPushBackInput.h
CommitLineData
1eee94d3
GM
1/* do not edit automatically generated by mc from PushBackInput. */
2/* PushBackInput.def provides a method for pushing back and consuming input.
3
83ffe9cd 4Copyright (C) 2001-2023 Free Software Foundation, Inc.
1eee94d3
GM
5Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
6
7This file is part of GNU Modula-2.
8
9GNU Modula-2 is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 3, or (at your option)
12any later version.
13
14GNU Modula-2 is distributed in the hope that it will be useful, but
15WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17General Public License for more details.
18
19Under Section 7 of GPL version 3, you are granted additional
20permissions described in the GCC Runtime Library Exception, version
213.1, as published by the Free Software Foundation.
22
23You should have received a copy of the GNU General Public License and
24a copy of the GCC Runtime Library Exception along with this program;
25see 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
35extern "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
57EXTERN 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
64EXTERN 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
71EXTERN char PushBackInput_PutCh (char ch);
72
73/*
74 PutString - pushes a string onto the push back stack.
75*/
76
77EXTERN 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
84EXTERN void PushBackInput_PutStr (DynamicStrings_String s);
85
86/*
87 Error - emits an error message with the appropriate file, line combination.
88*/
89
90EXTERN 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
98EXTERN 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
106EXTERN void PushBackInput_WarnString (DynamicStrings_String s);
107
108/*
109 Close - closes the opened file.
110*/
111
112EXTERN 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
118EXTERN unsigned int PushBackInput_GetExitStatus (void);
119
120/*
121 SetDebug - sets the debug flag on or off.
122*/
123
124EXTERN void PushBackInput_SetDebug (unsigned int d);
125
126/*
127 GetColumnPosition - returns the column position of the current character.
128*/
129
130EXTERN unsigned int PushBackInput_GetColumnPosition (void);
131
132/*
133 GetCurrentLine - returns the current line number.
134*/
135
136EXTERN unsigned int PushBackInput_GetCurrentLine (void);
137# ifdef __cplusplus
138}
139# endif
140
141# undef EXTERN
142#endif