]>
git.ipfire.org Git - thirdparty/gcc.git/blob - 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.
4 Copyright (C) 2001-2023 Free Software Foundation, Inc.
5 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
7 This file is part of GNU Modula-2.
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)
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.
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.
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/>. */
29 #if !defined (_PushBackInput_H)
30 # define _PushBackInput_H
37 # if !defined (PROC_D)
39 typedef void (*PROC_t
) (void);
40 typedef struct { PROC_t proc
; } PROC
;
44 # include "GDynamicStrings.h"
46 # if defined (_PushBackInput_C)
49 # define EXTERN extern
54 Open - opens a file for reading.
57 EXTERN FIO_File
PushBackInput_Open (const char *a_
, unsigned int _a_high
);
60 GetCh - gets a character from either the push back stack or
64 EXTERN
char PushBackInput_GetCh (FIO_File f
);
67 PutCh - pushes a character onto the push back stack, it also
68 returns the character which has been pushed.
71 EXTERN
char PushBackInput_PutCh (char ch
);
74 PutString - pushes a string onto the push back stack.
77 EXTERN
void PushBackInput_PutString (const char *a_
, unsigned int _a_high
);
80 PutStr - pushes a dynamic string onto the push back stack.
81 The string, s, is not deallocated.
84 EXTERN
void PushBackInput_PutStr (DynamicStrings_String s
);
87 Error - emits an error message with the appropriate file, line combination.
90 EXTERN
void PushBackInput_Error (const char *a_
, unsigned int _a_high
);
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
98 EXTERN
void PushBackInput_WarnError (const char *a_
, unsigned int _a_high
);
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
106 EXTERN
void PushBackInput_WarnString (DynamicStrings_String s
);
109 Close - closes the opened file.
112 EXTERN
void PushBackInput_Close (FIO_File f
);
115 GetExitStatus - returns the exit status which will be 1 if any warnings were issued.
118 EXTERN
unsigned int PushBackInput_GetExitStatus (void);
121 SetDebug - sets the debug flag on or off.
124 EXTERN
void PushBackInput_SetDebug (unsigned int d
);
127 GetColumnPosition - returns the column position of the current character.
130 EXTERN
unsigned int PushBackInput_GetColumnPosition (void);
133 GetCurrentLine - returns the current line number.
136 EXTERN
unsigned int PushBackInput_GetCurrentLine (void);