2002-11-21 Andrew Cagney <ac131313@redhat.com>
[external/binutils.git] / sim / igen / lf.h
1 /* The IGEN simulator generator for GDB, the GNU Debugger.
2
3    Copyright 2002 Free Software Foundation, Inc.
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
11    the Free Software Foundation; either version 2 of the License, or
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
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 59 Temple Place - Suite 330,
22    Boston, MA 02111-1307, USA.  */
23
24
25
26 /* LF: Line Numbered Output Stream */
27
28 typedef struct _lf lf;
29
30 typedef enum {
31   lf_is_h,
32   lf_is_c,
33   lf_is_text,
34 } lf_file_type;
35
36
37 typedef enum {
38   lf_include_references,
39   lf_omit_references,
40 } lf_file_references;
41
42
43 /* Open the file NAME for writing ("-" for stdout).  Use REAL_NAME
44    when refering to the opened file.  Line number information (in the
45    output) can be suppressed with FILE_REFERENCES ==
46    LF_OMIT_REFERENCES.  TYPE is to determine the formatting of some of
47    the print messages below. */
48
49 extern lf *lf_open
50 (char *name,
51  char *real_name,
52  lf_file_references file_references,
53  lf_file_type type,
54  const char *program);
55
56 extern void lf_close
57 (lf *file);
58
59
60 /* Basic output functions */
61
62 extern int lf_write
63 (lf *file,
64  const char *string,
65  int len);
66
67 extern int lf_putchr
68 (lf *file,
69  const char ch);
70
71 extern int lf_putstr
72 (lf *file,
73  const char *string);
74
75 extern int lf_putint
76 (lf *file,
77  int decimal);
78
79 extern int lf_putbin
80 (lf *file,
81  int decimal,
82  int width);
83
84 extern int lf_printf
85 (lf *file,
86  const char *fmt,
87  ...) __attribute__((format(printf, 2, 3)));
88
89
90 /* Indentation control.
91
92    lf_indent_suppress suppresses indentation on the next line (current
93    line if that has not yet been started) */
94
95 extern void lf_indent_suppress
96 (lf *file);
97
98 extern void lf_indent
99 (lf *file,
100  int delta);
101
102
103 /* Print generic text: */
104
105
106 extern int lf_print__gnu_copyleft
107 (lf *file);
108
109 extern int lf_print__file_start
110 (lf *file);
111
112 extern int lf_print__this_file_is_empty
113 (lf *file,
114  const char *reason);
115
116 extern int lf_print__file_finish
117 (lf *file);
118
119 extern int lf_print__internal_ref
120 (lf *file);
121
122 extern int lf_print__external_ref
123 (lf *file,
124  int line_nr,
125  const char *file_name);
126
127 extern int lf_print__line_ref
128 (lf *file,
129  line_ref *line);
130
131 extern int lf_print__ucase_filename
132 (lf *file);
133
134 extern int lf_print__function_type
135 (lf *file,
136  const char *type,
137  const char *prefix,
138  const char *trailing_space);
139
140 typedef int print_function(lf *file);
141
142 extern int lf_print__function_type_function
143 (lf *file,
144  print_function *print_type,
145  const char *prefix,
146  const char *trailing_space);
147