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