1 /* do not edit automatically generated by mc from mcPretty. */
2 /* mcPretty.def provides an interface to the pretty printing of output code.
4 Copyright (C) 2016-2022 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 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/>. */
24 #if !defined (_mcPretty_H)
32 # if !defined (PROC_D)
34 typedef void (*PROC_t
) (void);
35 typedef struct { PROC_t proc
; } PROC
;
38 # include "GDynamicStrings.h"
40 # if defined (_mcPretty_C)
43 # define EXTERN extern
46 #if !defined (mcPretty_pretty_D)
47 # define mcPretty_pretty_D
48 typedef void *mcPretty_pretty
;
51 typedef struct mcPretty_writeProc_p mcPretty_writeProc
;
53 typedef struct mcPretty_writeLnProc_p mcPretty_writeLnProc
;
55 typedef void (*mcPretty_writeProc_t
) (char);
56 struct mcPretty_writeProc_p
{ mcPretty_writeProc_t proc
; };
58 typedef void (*mcPretty_writeLnProc_t
) (void);
59 struct mcPretty_writeLnProc_p
{ mcPretty_writeLnProc_t proc
; };
63 initPretty - initialise a pretty print data structure.
66 EXTERN mcPretty_pretty
mcPretty_initPretty (mcPretty_writeProc w
, mcPretty_writeLnProc l
);
69 dupPretty - duplicate a pretty print data structure.
72 EXTERN mcPretty_pretty
mcPretty_dupPretty (mcPretty_pretty p
);
75 killPretty - destroy a pretty print data structure.
76 Post condition: p is assigned to NIL.
79 EXTERN
void mcPretty_killPretty (mcPretty_pretty
*p
);
82 pushPretty - duplicate, p. Push, p, and return the duplicate.
85 EXTERN mcPretty_pretty
mcPretty_pushPretty (mcPretty_pretty p
);
88 popPretty - pops the pretty object from the stack.
91 EXTERN mcPretty_pretty
mcPretty_popPretty (mcPretty_pretty p
);
94 getindent - returns the current indent value.
97 EXTERN
unsigned int mcPretty_getindent (mcPretty_pretty p
);
100 setindent - sets the current indent to, n.
103 EXTERN
void mcPretty_setindent (mcPretty_pretty p
, unsigned int n
);
106 getcurpos - returns the current cursor position.
109 EXTERN
unsigned int mcPretty_getcurpos (mcPretty_pretty s
);
112 getseekpos - returns the seek position.
115 EXTERN
unsigned int mcPretty_getseekpos (mcPretty_pretty s
);
118 getcurline - returns the current line number.
121 EXTERN
unsigned int mcPretty_getcurline (mcPretty_pretty s
);
124 setNeedSpace - sets needSpace flag to TRUE.
127 EXTERN
void mcPretty_setNeedSpace (mcPretty_pretty s
);
130 noSpace - unset needsSpace.
133 EXTERN
void mcPretty_noSpace (mcPretty_pretty s
);
136 print - print a string using, p.
139 EXTERN
void mcPretty_print (mcPretty_pretty p
, const char *a_
, unsigned int _a_high
);
142 prints - print a string using, p.
145 EXTERN
void mcPretty_prints (mcPretty_pretty p
, DynamicStrings_String s
);
148 raw - print out string, s, without any translation of
152 EXTERN
void mcPretty_raw (mcPretty_pretty p
, DynamicStrings_String s
);