1 /* do not edit automatically generated by mc from Output. */
2 /* Output.def redirect output.
4 Copyright (C) 2021-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 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 (_Output_H)
32 # if !defined (PROC_D)
34 typedef void (*PROC_t
) (void);
35 typedef struct { PROC_t proc
; } PROC
;
38 # include "GNameKey.h"
39 # include "GDynamicStrings.h"
41 # if defined (_Output_C)
44 # define EXTERN extern
49 Open - attempt to open filename as the output file.
50 TRUE is returned if success, FALSE otherwise.
53 EXTERN
unsigned int Output_Open (const char *filename_
, unsigned int _filename_high
);
56 Close - close the output file.
59 EXTERN
void Output_Close (void);
62 Write - write a single character to the output file.
65 EXTERN
void Output_Write (char ch
);
68 WriteString - write an unformatted string to the output.
71 EXTERN
void Output_WriteString (const char *s_
, unsigned int _s_high
);
74 KillWriteS - write a string to the output and free the string afterwards.
77 EXTERN
void Output_KillWriteS (DynamicStrings_String s
);
80 WriteS - write a string to the output. The string is not freed.
83 EXTERN
void Output_WriteS (DynamicStrings_String s
);
86 WriteKey - write a key to the output.
89 EXTERN
void Output_WriteKey (NameKey_Name key
);
92 WriteLn - write a newline to the output.
95 EXTERN
void Output_WriteLn (void);
98 WriteCard - write a cardinal using fieldlength characters.
101 EXTERN
void Output_WriteCard (unsigned int card
, unsigned int fieldlength
);
104 StartBuffer - create a buffer into which any output is redirected.
107 EXTERN
void Output_StartBuffer (void);
110 EndBuffer - end the redirection and return the contents of the buffer.
113 EXTERN DynamicStrings_String
Output_EndBuffer (void);