Subversion Repositories tendra.SVN

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
 
31
/*** c-out-info.h --- Output control ADT.
32
 *
33
 ** Author: Steve Folkes <smf@hermes.mod.uk>
34
 *
35
 *** Commentary:
36
 *
37
 * See the file "c-out-info.c" for more information.
38
 *
39
 *** Change Log:
40
 * $Log: c-out-info.h,v $
41
 * Revision 1.1.1.1  1998/01/17  15:57:43  release
42
 * First version to be checked into rolling release.
43
 *
44
 * Revision 1.3  1996/03/01  09:53:15  smf
45
 * c-code.c, c-out-info.c, c-out-info.h, c-output.c:
46
 * 	- improved unreachable code analysis;
47
 * 	- improved some output formatting;
48
 * 	- added support for comment or macro to mark unreachable code.
49
 *
50
 * Revision 1.2  1994/12/15  09:56:29  smf
51
 * Brought into line with OSSG C Coding Standards Document, as per
52
 * "CR94_178.sid+tld-update".
53
 *
54
 * Revision 1.1.1.1  1994/07/25  16:04:18  smf
55
 * Initial import of SID 1.8 non shared files.
56
 *
57
**/
58
 
59
/****************************************************************************/
60
 
61
#ifndef H_C_OUT_INFO
62
#define H_C_OUT_INFO
63
 
64
#include "os-interface.h"
65
#include "dstring.h"
66
#include "ostream.h"
67
#include "output.h"
68
 
69
/*To avoid circularity:*/
70
struct CCodeT;
71
 
72
/*--------------------------------------------------------------------------*/
73
 
74
#ifdef FS_NO_ENUM
75
typedef int CPrefixT, *CPrefixP;
76
#define CPFX_TYPE		(0)
77
#define CPFX_FN			(1)
78
#define CPFX_IN			(2)
79
#define CPFX_OUT		(3)
80
#define CPFX_LABEL		(4)
81
#define CPFX_TERMINAL		(5)
82
#define CPFX_NUM_PREFIXES	(6)
83
#else
84
typedef enum {
85
    CPFX_TYPE,
86
    CPFX_FN,
87
    CPFX_IN,
88
    CPFX_OUT,
89
    CPFX_LABEL,
90
    CPFX_TERMINAL,
91
    CPFX_NUM_PREFIXES
92
} CPrefixT, *CPrefixP;
93
#endif /* defined (FS_NO_ENUM) */
94
 
95
typedef struct COutputInfoT {
96
    OutputInfoP		info;
97
    struct CCodeT      *header1;
98
    struct CCodeT      *header2;
99
    struct CCodeT      *trailer1;
100
    struct CCodeT      *trailer2;
101
    NStringT		prefixes [CPFX_NUM_PREFIXES];
102
    BoolT		prototypes;
103
    BoolT		ossg;
104
    BoolT		numeric_ids;
105
    BoolT		casts;
106
    BoolT		unreachable;
107
    BoolT		lines;
108
    unsigned		split;
109
} COutputInfoT, *COutputInfoP;
110
 
111
/*--------------------------------------------------------------------------*/
112
 
113
extern void			c_out_info_init
114
	PROTO_S ((COutputInfoP, OutputInfoP));
115
extern OutputInfoP		c_out_info_info
116
	PROTO_S ((COutputInfoP));
117
extern OStreamP			c_out_info_ostream
118
	PROTO_S ((COutputInfoP));
119
extern CStringP			c_out_info_program_name
120
	PROTO_S ((COutputInfoP));
121
extern CStringP			c_out_info_source_name
122
	PROTO_S ((COutputInfoP));
123
extern CStringP			c_out_info_c_source_name
124
	PROTO_S ((COutputInfoP));
125
extern struct CCodeT	       *c_out_info_get_header1
126
	PROTO_S ((COutputInfoP));
127
extern void			c_out_info_set_header1
128
	PROTO_S ((COutputInfoP, struct CCodeT *));
129
extern struct CCodeT	       *c_out_info_get_header2
130
	PROTO_S ((COutputInfoP));
131
extern void			c_out_info_set_header2
132
	PROTO_S ((COutputInfoP, struct CCodeT *));
133
extern struct CCodeT	       *c_out_info_get_trailer1
134
	PROTO_S ((COutputInfoP));
135
extern void			c_out_info_set_trailer1
136
	PROTO_S ((COutputInfoP, struct CCodeT *));
137
extern struct CCodeT	       *c_out_info_get_trailer2
138
	PROTO_S ((COutputInfoP));
139
extern void			c_out_info_set_trailer2
140
	PROTO_S ((COutputInfoP, struct CCodeT *));
141
extern NStringP			c_out_info_type_prefix
142
	PROTO_S ((COutputInfoP));
143
extern NStringP			c_out_info_fn_prefix
144
	PROTO_S ((COutputInfoP));
145
extern NStringP			c_out_info_in_prefix
146
	PROTO_S ((COutputInfoP));
147
extern NStringP			c_out_info_out_prefix
148
	PROTO_S ((COutputInfoP));
149
extern NStringP			c_out_info_label_prefix
150
	PROTO_S ((COutputInfoP));
151
extern NStringP			c_out_info_terminal_prefix
152
	PROTO_S ((COutputInfoP));
153
extern NStringP			c_out_info_prefix
154
	PROTO_S ((COutputInfoP, CPrefixT));
155
extern BoolT			c_out_info_get_prototypes
156
	PROTO_S ((COutputInfoP));
157
extern void			c_out_info_set_prototypes
158
	PROTO_S ((COutputInfoP, BoolT));
159
extern BoolT			c_out_info_get_ossg
160
	PROTO_S ((COutputInfoP));
161
extern void			c_out_info_set_ossg
162
	PROTO_S ((COutputInfoP, BoolT));
163
extern BoolT			c_out_info_get_numeric_ids
164
	PROTO_S ((COutputInfoP));
165
extern void			c_out_info_set_numeric_ids
166
	PROTO_S ((COutputInfoP, BoolT));
167
extern BoolT			c_out_info_get_casts
168
	PROTO_S ((COutputInfoP));
169
extern void			c_out_info_set_casts
170
	PROTO_S ((COutputInfoP, BoolT));
171
extern BoolT			c_out_info_get_unreachable
172
	PROTO_S ((COutputInfoP));
173
extern void			c_out_info_set_unreachable
174
	PROTO_S ((COutputInfoP, BoolT));
175
extern BoolT			c_out_info_get_lines
176
	PROTO_S ((COutputInfoP));
177
extern void			c_out_info_set_lines
178
	PROTO_S ((COutputInfoP, BoolT));
179
extern unsigned			c_out_info_get_split
180
	PROTO_S ((COutputInfoP));
181
extern void			c_out_info_set_split
182
	PROTO_S ((COutputInfoP, unsigned));
183
 
184
/*--------------------------------------------------------------------------*/
185
 
186
#ifdef FS_FAST
187
#define c_out_info_info(o) ((o)->info)
188
#define c_out_info_ostream(o) (out_info_get_current_ostream ((o)->info))
189
#define c_out_info_program_name(o) (out_info_get_prog_name ((o)->info))
190
#define c_out_info_source_name(o) \
191
(out_info_get_infile_name ((o)->info, (unsigned) 0))
192
#define c_out_info_c_source_name(o) \
193
(out_info_get_infile_name ((o)->info, (unsigned) 1))
194
#define c_out_info_get_header1(o) ((o)->header1)
195
#define c_out_info_set_header1(o, c) ((o)->header1 = (c))
196
#define c_out_info_get_header2(o) ((o)->header2)
197
#define c_out_info_set_header2(o, c) ((o)->header2 = (c))
198
#define c_out_info_get_trailer1(o) ((o)->trailer1)
199
#define c_out_info_set_trailer1(o, c) ((o)->trailer1 = (c))
200
#define c_out_info_get_trailer2(o) ((o)->trailer2)
201
#define c_out_info_set_trailer2(o, c) ((o)->trailer2 = (c))
202
#define c_out_info_type_prefix(o) (&((o)->prefixes [CPFX_TYPE]))
203
#define c_out_info_fn_prefix(o) (&((o)->prefixes [CPFX_FN]))
204
#define c_out_info_in_prefix(o) (&((o)->prefixes [CPFX_IN]))
205
#define c_out_info_out_prefix(o) (&((o)->prefixes [CPFX_OUT]))
206
#define c_out_info_label_prefix(o) (&((o)->prefixes [CPFX_LABEL]))
207
#define c_out_info_terminal_prefix(o) (&((o)->prefixes [CPFX_TERMINAL]))
208
#define c_out_info_prefix(o, i) (&((o)->prefixes [(i)]))
209
#define c_out_info_get_prototypes(o) ((o)->prototypes)
210
#define c_out_info_set_prototypes(o, b) ((o)->prototypes = (b))
211
#define c_out_info_get_ossg(o) ((o)->ossg)
212
#define c_out_info_set_ossg(o, b) ((o)->ossg = (b))
213
#define c_out_info_get_numeric_ids(o) ((o)->numeric_ids)
214
#define c_out_info_set_numeric_ids(o, b) ((o)->numeric_ids = (b))
215
#define c_out_info_get_casts(o) ((o)->casts)
216
#define c_out_info_set_casts(o, b) ((o)->casts = (b))
217
#define c_out_info_get_unreachable(o) ((o)->unreachable)
218
#define c_out_info_set_unreachable(o, b) ((o)->unreachable = (b))
219
#define c_out_info_get_lines(o) ((o)->lines)
220
#define c_out_info_set_lines(o, b) ((o)->lines = (b))
221
#define c_out_info_get_split(o) ((o)->split)
222
#define c_out_info_set_split(o, n) ((o)->split = (n))
223
#endif /* defined (FS_FAST) */
224
 
225
#endif /* !defined (H_C_OUT_INFO) */
226
 
227
/*
228
 * Local variables(smf):
229
 * eval: (include::add-path-entry "../os-interface" "../library")
230
 * eval: (include::add-path-entry "../transforms" "../output" "../generated")
231
 * end:
232
**/