]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - sim/igen/lf.h
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / sim / igen / lf.h
CommitLineData
feaee4bd
AC
1/* The IGEN simulator generator for GDB, the GNU Debugger.
2
1d506c26 3 Copyright 2002-2024 Free Software Foundation, Inc.
feaee4bd
AC
4
5 Contributed by Andrew Cagney.
6
7 This file is part of GDB.
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
4744ac1b 11 the Free Software Foundation; either version 3 of the License, or
feaee4bd
AC
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
4744ac1b 20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
feaee4bd 21
339e44f8
MF
22#ifndef IGEN_LF_H
23#define IGEN_LF_H
24
f0c4dc40 25#include "ansidecl.h"
339e44f8 26#include "misc.h"
c906108c
SS
27
28/* LF: Line Numbered Output Stream */
29
30typedef struct _lf lf;
31
4e0bf4c4
AC
32typedef enum
33{
c906108c
SS
34 lf_is_h,
35 lf_is_c,
36 lf_is_text,
4e0bf4c4
AC
37}
38lf_file_type;
c906108c
SS
39
40
4e0bf4c4
AC
41typedef enum
42{
c906108c
SS
43 lf_include_references,
44 lf_omit_references,
4e0bf4c4
AC
45}
46lf_file_references;
c906108c
SS
47
48
49/* Open the file NAME for writing ("-" for stdout). Use REAL_NAME
50 when refering to the opened file. Line number information (in the
51 output) can be suppressed with FILE_REFERENCES ==
52 LF_OMIT_REFERENCES. TYPE is to determine the formatting of some of
53 the print messages below. */
54
55extern lf *lf_open
fa654e74
MF
56 (const char *name,
57 const char *real_name,
4e0bf4c4
AC
58 lf_file_references file_references,
59 lf_file_type type, const char *program);
c906108c 60
c4df5bbe
SH
61extern lf_file_type lf_get_file_type (const lf *file);
62
4e0bf4c4 63extern void lf_close (lf *file);
c906108c
SS
64
65
66/* Basic output functions */
67
4e0bf4c4 68extern int lf_write (lf *file, const char *string, int len);
c906108c 69
4e0bf4c4 70extern int lf_putchr (lf *file, const char ch);
c906108c 71
4e0bf4c4 72extern int lf_putstr (lf *file, const char *string);
c906108c 73
4e0bf4c4 74extern int lf_putint (lf *file, int decimal);
c906108c 75
4e0bf4c4 76extern int lf_putbin (lf *file, int decimal, int width);
c906108c
SS
77
78extern int lf_printf
f0c4dc40 79 (lf *file, const char *fmt, ...) ATTRIBUTE_PRINTF (2, 3);
c906108c
SS
80
81
82/* Indentation control.
83
84 lf_indent_suppress suppresses indentation on the next line (current
85 line if that has not yet been started) */
86
4e0bf4c4 87extern void lf_indent_suppress (lf *file);
c906108c 88
4e0bf4c4 89extern void lf_indent (lf *file, int delta);
c906108c
SS
90
91
92/* Print generic text: */
93
94
4e0bf4c4 95extern int lf_print__gnu_copyleft (lf *file);
c906108c 96
4e0bf4c4 97extern int lf_print__file_start (lf *file);
c906108c 98
4e0bf4c4 99extern int lf_print__this_file_is_empty (lf *file, const char *reason);
c906108c 100
4e0bf4c4 101extern int lf_print__file_finish (lf *file);
c906108c 102
4e0bf4c4 103extern int lf_print__internal_ref (lf *file);
c906108c
SS
104
105extern int lf_print__external_ref
4e0bf4c4 106 (lf *file, int line_nr, const char *file_name);
c906108c 107
fa654e74 108extern int lf_print__line_ref (lf *file, const line_ref *line);
c906108c 109
4e0bf4c4 110extern int lf_print__ucase_filename (lf *file);
c906108c
SS
111
112extern int lf_print__function_type
4e0bf4c4
AC
113 (lf *file,
114 const char *type, const char *prefix, const char *trailing_space);
c906108c 115
4e0bf4c4 116typedef int print_function (lf *file);
c906108c
SS
117
118extern int lf_print__function_type_function
4e0bf4c4
AC
119 (lf *file,
120 print_function * print_type,
121 const char *prefix, const char *trailing_space);
339e44f8
MF
122
123#endif /* IGEN_LF_H */