]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/m2/mc-boot/GmcPretty.h
Merge modula-2 front end onto gcc.
[thirdparty/gcc.git] / gcc / m2 / mc-boot / GmcPretty.h
1 /* do not edit automatically generated by mc from mcPretty. */
2 /* mcPretty.def provides an interface to the pretty printing of output code.
3
4 Copyright (C) 2016-2022 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 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 (_mcPretty_H)
25 # define _mcPretty_H
26
27 #include "config.h"
28 #include "system.h"
29 # ifdef __cplusplus
30 extern "C" {
31 # endif
32 # if !defined (PROC_D)
33 # define PROC_D
34 typedef void (*PROC_t) (void);
35 typedef struct { PROC_t proc; } PROC;
36 # endif
37
38 # include "GDynamicStrings.h"
39
40 # if defined (_mcPretty_C)
41 # define EXTERN
42 # else
43 # define EXTERN extern
44 # endif
45
46 #if !defined (mcPretty_pretty_D)
47 # define mcPretty_pretty_D
48 typedef void *mcPretty_pretty;
49 #endif
50
51 typedef struct mcPretty_writeProc_p mcPretty_writeProc;
52
53 typedef struct mcPretty_writeLnProc_p mcPretty_writeLnProc;
54
55 typedef void (*mcPretty_writeProc_t) (char);
56 struct mcPretty_writeProc_p { mcPretty_writeProc_t proc; };
57
58 typedef void (*mcPretty_writeLnProc_t) (void);
59 struct mcPretty_writeLnProc_p { mcPretty_writeLnProc_t proc; };
60
61
62 /*
63 initPretty - initialise a pretty print data structure.
64 */
65
66 EXTERN mcPretty_pretty mcPretty_initPretty (mcPretty_writeProc w, mcPretty_writeLnProc l);
67
68 /*
69 dupPretty - duplicate a pretty print data structure.
70 */
71
72 EXTERN mcPretty_pretty mcPretty_dupPretty (mcPretty_pretty p);
73
74 /*
75 killPretty - destroy a pretty print data structure.
76 Post condition: p is assigned to NIL.
77 */
78
79 EXTERN void mcPretty_killPretty (mcPretty_pretty *p);
80
81 /*
82 pushPretty - duplicate, p. Push, p, and return the duplicate.
83 */
84
85 EXTERN mcPretty_pretty mcPretty_pushPretty (mcPretty_pretty p);
86
87 /*
88 popPretty - pops the pretty object from the stack.
89 */
90
91 EXTERN mcPretty_pretty mcPretty_popPretty (mcPretty_pretty p);
92
93 /*
94 getindent - returns the current indent value.
95 */
96
97 EXTERN unsigned int mcPretty_getindent (mcPretty_pretty p);
98
99 /*
100 setindent - sets the current indent to, n.
101 */
102
103 EXTERN void mcPretty_setindent (mcPretty_pretty p, unsigned int n);
104
105 /*
106 getcurpos - returns the current cursor position.
107 */
108
109 EXTERN unsigned int mcPretty_getcurpos (mcPretty_pretty s);
110
111 /*
112 getseekpos - returns the seek position.
113 */
114
115 EXTERN unsigned int mcPretty_getseekpos (mcPretty_pretty s);
116
117 /*
118 getcurline - returns the current line number.
119 */
120
121 EXTERN unsigned int mcPretty_getcurline (mcPretty_pretty s);
122
123 /*
124 setNeedSpace - sets needSpace flag to TRUE.
125 */
126
127 EXTERN void mcPretty_setNeedSpace (mcPretty_pretty s);
128
129 /*
130 noSpace - unset needsSpace.
131 */
132
133 EXTERN void mcPretty_noSpace (mcPretty_pretty s);
134
135 /*
136 print - print a string using, p.
137 */
138
139 EXTERN void mcPretty_print (mcPretty_pretty p, const char *a_, unsigned int _a_high);
140
141 /*
142 prints - print a string using, p.
143 */
144
145 EXTERN void mcPretty_prints (mcPretty_pretty p, DynamicStrings_String s);
146
147 /*
148 raw - print out string, s, without any translation of
149 escape sequences.
150 */
151
152 EXTERN void mcPretty_raw (mcPretty_pretty p, DynamicStrings_String s);
153 # ifdef __cplusplus
154 }
155 # endif
156
157 # undef EXTERN
158 #endif