Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – tendra.SVN – Blame – /branches/tendra5/src/utilities/sid/c-out-info.c – Rev 2

Subversion Repositories tendra.SVN

Rev

Go to most recent revision | Details | 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.c --- Output control ADT.
32
 *
33
 ** Author: Steve Folkes <smf@hermes.mod.uk>
34
 *
35
 *** Commentary:
36
 *
37
 * This file implements the SID output information routines.
38
 *
39
 *** Change Log:
40
 * $Log: c-out-info.c,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:14  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:27  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
#include "c-out-info.h"
62
#include "c-code.h"
63
 
64
/*--------------------------------------------------------------------------*/
65
 
66
void
67
c_out_info_init PROTO_N ((info, out_info))
68
		PROTO_T (COutputInfoP info X
69
			 OutputInfoP  out_info)
70
{
71
    info->info        = out_info;
72
    info->header1     = NIL (CCodeP);
73
    info->header2     = NIL (CCodeP);
74
    info->trailer1    = NIL (CCodeP);
75
    info->trailer2    = NIL (CCodeP);
76
    nstring_copy_cstring (c_out_info_type_prefix (info), "ZT");
77
    nstring_copy_cstring (c_out_info_fn_prefix (info), "ZR");
78
    nstring_copy_cstring (c_out_info_in_prefix (info), "ZI");
79
    nstring_copy_cstring (c_out_info_out_prefix (info), "ZO");
80
    nstring_copy_cstring (c_out_info_label_prefix (info), "ZL");
81
    nstring_copy_cstring (c_out_info_terminal_prefix (info), "ZB");
82
    info->prototypes  = FALSE;
83
    info->ossg        = FALSE;
84
    info->numeric_ids = FALSE;
85
    info->casts       = FALSE;
86
    info->unreachable = FALSE;
87
    info->lines       = TRUE;
88
    info->split       = 0;
89
}
90
 
91
#ifdef FS_FAST
92
#undef c_out_info_info
93
#endif /* defined (FS_FAST) */
94
OutputInfoP
95
c_out_info_info PROTO_N ((info))
96
		PROTO_T (COutputInfoP info)
97
{
98
    return (info->info);
99
}
100
#ifdef FS_FAST
101
#define c_out_info_info(o) ((o)->info)
102
#endif /* defined (FS_FAST) */
103
 
104
#ifdef FS_FAST
105
#undef c_out_info_ostream
106
#endif /* defined (FS_FAST) */
107
OStreamP
108
c_out_info_ostream PROTO_N ((info))
109
		   PROTO_T (COutputInfoP info)
110
{
111
    return (out_info_get_current_ostream (info->info));
112
}
113
#ifdef FS_FAST
114
#define c_out_info_ostream(o) (out_info_get_current_ostream ((o)->info))
115
#endif /* defined (FS_FAST) */
116
 
117
#ifdef FS_FAST
118
#undef c_out_info_program_name
119
#endif /* defined (FS_FAST) */
120
CStringP
121
c_out_info_program_name PROTO_N ((info))
122
			PROTO_T (COutputInfoP info)
123
{
124
    return (out_info_get_prog_name (info->info));
125
}
126
#ifdef FS_FAST
127
#define c_out_info_program_name(o) (out_info_get_prog_name ((o)->info))
128
#endif /* defined (FS_FAST) */
129
 
130
#ifdef FS_FAST
131
#undef c_out_info_source_name
132
#endif /* defined (FS_FAST) */
133
CStringP
134
c_out_info_source_name PROTO_N ((info))
135
		       PROTO_T (COutputInfoP info)
136
{
137
    return (out_info_get_infile_name (info->info, (unsigned) 0));
138
}
139
#ifdef FS_FAST
140
#define c_out_info_source_name(o) \
141
(out_info_get_infile_name ((o)->info, (unsigned) 0))
142
#endif /* defined (FS_FAST) */
143
 
144
#ifdef FS_FAST
145
#undef c_out_info_c_source_name
146
#endif /* defined (FS_FAST) */
147
CStringP
148
c_out_info_c_source_name PROTO_N ((info))
149
			 PROTO_T (COutputInfoP info)
150
{
151
    return (out_info_get_infile_name (info->info, (unsigned) 1));
152
}
153
#ifdef FS_FAST
154
#define c_out_info_c_source_name(o) \
155
(out_info_get_infile_name ((o)->info, (unsigned) 1))
156
#endif /* defined (FS_FAST) */
157
 
158
#ifdef FS_FAST
159
#undef c_out_info_get_header1
160
#endif /* defined (FS_FAST) */
161
CCodeP
162
c_out_info_get_header1 PROTO_N ((info))
163
		       PROTO_T (COutputInfoP info)
164
{
165
    return (info->header1);
166
}
167
#ifdef FS_FAST
168
#define c_out_info_get_header1(o) ((o)->header1)
169
#endif /* defined (FS_FAST) */
170
 
171
#ifdef FS_FAST
172
#undef c_out_info_set_header1
173
#endif /* defined (FS_FAST) */
174
void
175
c_out_info_set_header1 PROTO_N ((info, code))
176
		       PROTO_T (COutputInfoP info X
177
				CCodeP       code)
178
{
179
    info->header1 = code;
180
}
181
#ifdef FS_FAST
182
#define c_out_info_set_header1(o, c) ((o)->header1 = (c))
183
#endif /* defined (FS_FAST) */
184
 
185
#ifdef FS_FAST
186
#undef c_out_info_get_header2
187
#endif /* defined (FS_FAST) */
188
CCodeP
189
c_out_info_get_header2 PROTO_N ((info))
190
		       PROTO_T (COutputInfoP info)
191
{
192
    return (info->header2);
193
}
194
#ifdef FS_FAST
195
#define c_out_info_get_header2(o) ((o)->header2)
196
#endif /* defined (FS_FAST) */
197
 
198
#ifdef FS_FAST
199
#undef c_out_info_set_header2
200
#endif /* defined (FS_FAST) */
201
void
202
c_out_info_set_header2 PROTO_N ((info, code))
203
		       PROTO_T (COutputInfoP info X
204
				CCodeP       code)
205
{
206
    info->header2 = code;
207
}
208
#ifdef FS_FAST
209
#define c_out_info_set_header2(o, c) ((o)->header2 = (c))
210
#endif /* defined (FS_FAST) */
211
 
212
#ifdef FS_FAST
213
#undef c_out_info_get_trailer1
214
#endif /* defined (FS_FAST) */
215
CCodeP
216
c_out_info_get_trailer1 PROTO_N ((info))
217
			PROTO_T (COutputInfoP info)
218
{
219
    return (info->trailer1);
220
}
221
#ifdef FS_FAST
222
#define c_out_info_get_trailer1(o) ((o)->trailer1)
223
#endif /* defined (FS_FAST) */
224
 
225
#ifdef FS_FAST
226
#undef c_out_info_set_trailer1
227
#endif /* defined (FS_FAST) */
228
void
229
c_out_info_set_trailer1 PROTO_N ((info, code))
230
			PROTO_T (COutputInfoP info X
231
				 CCodeP       code)
232
{
233
    info->trailer1 = code;
234
}
235
#ifdef FS_FAST
236
#define c_out_info_set_trailer1(o, c) ((o)->trailer1 = (c))
237
#endif /* defined (FS_FAST) */
238
 
239
#ifdef FS_FAST
240
#undef c_out_info_get_trailer2
241
#endif /* defined (FS_FAST) */
242
CCodeP
243
c_out_info_get_trailer2 PROTO_N ((info))
244
			PROTO_T (COutputInfoP info)
245
{
246
    return (info->trailer2);
247
}
248
#ifdef FS_FAST
249
#define c_out_info_get_trailer2(o) ((o)->trailer2)
250
#endif /* defined (FS_FAST) */
251
 
252
#ifdef FS_FAST
253
#undef c_out_info_set_trailer2
254
#endif /* defined (FS_FAST) */
255
void
256
c_out_info_set_trailer2 PROTO_N ((info, code))
257
			PROTO_T (COutputInfoP info X
258
				 CCodeP       code)
259
{
260
    info->trailer2 = code;
261
}
262
#ifdef FS_FAST
263
#define c_out_info_set_trailer2(o, c) ((o)->trailer2 = (c))
264
#endif /* defined (FS_FAST) */
265
 
266
#ifdef FS_FAST
267
#undef c_out_info_type_prefix
268
#endif /* defined (FS_FAST) */
269
NStringP
270
c_out_info_type_prefix PROTO_N ((info))
271
		       PROTO_T (COutputInfoP info)
272
{
273
    return (&(info->prefixes [CPFX_TYPE]));
274
}
275
#ifdef FS_FAST
276
#define c_out_info_type_prefix(o) (&((o)->prefixes [CPFX_TYPE]))
277
#endif /* defined (FS_FAST) */
278
 
279
#ifdef FS_FAST
280
#undef c_out_info_fn_prefix
281
#endif /* defined (FS_FAST) */
282
NStringP
283
c_out_info_fn_prefix PROTO_N ((info))
284
		     PROTO_T (COutputInfoP info)
285
{
286
    return (&(info->prefixes [CPFX_FN]));
287
}
288
#ifdef FS_FAST
289
#define c_out_info_fn_prefix(o) (&((o)->prefixes [CPFX_FN]))
290
#endif /* defined (FS_FAST) */
291
 
292
#ifdef FS_FAST
293
#undef c_out_info_in_prefix
294
#endif /* defined (FS_FAST) */
295
NStringP
296
c_out_info_in_prefix PROTO_N ((info))
297
		     PROTO_T (COutputInfoP info)
298
{
299
    return (&(info->prefixes [CPFX_IN]));
300
}
301
#ifdef FS_FAST
302
#define c_out_info_in_prefix(o) (&((o)->prefixes [CPFX_IN]))
303
#endif /* defined (FS_FAST) */
304
 
305
#ifdef FS_FAST
306
#undef c_out_info_out_prefix
307
#endif /* defined (FS_FAST) */
308
NStringP
309
c_out_info_out_prefix PROTO_N ((info))
310
		      PROTO_T (COutputInfoP info)
311
{
312
    return (&(info->prefixes [CPFX_OUT]));
313
}
314
#ifdef FS_FAST
315
#define c_out_info_out_prefix(o) (&((o)->prefixes [CPFX_OUT]))
316
#endif /* defined (FS_FAST) */
317
 
318
#ifdef FS_FAST
319
#undef c_out_info_label_prefix
320
#endif /* defined (FS_FAST) */
321
NStringP
322
c_out_info_label_prefix PROTO_N ((info))
323
			PROTO_T (COutputInfoP info)
324
{
325
    return (&(info->prefixes [CPFX_LABEL]));
326
}
327
#ifdef FS_FAST
328
#define c_out_info_label_prefix(o) (&((o)->prefixes [CPFX_LABEL]))
329
#endif /* defined (FS_FAST) */
330
 
331
#ifdef FS_FAST
332
#undef c_out_info_terminal_prefix
333
#endif /* defined (FS_FAST) */
334
NStringP
335
c_out_info_terminal_prefix PROTO_N ((info))
336
			   PROTO_T (COutputInfoP info)
337
{
338
    return (&(info->prefixes [CPFX_TERMINAL]));
339
}
340
#ifdef FS_FAST
341
#define c_out_info_terminal_prefix(o) (&((o)->prefixes [CPFX_TERMINAL]))
342
#endif /* defined (FS_FAST) */
343
 
344
#ifdef FS_FAST
345
#undef c_out_info_prefix
346
#endif /* defined (FS_FAST) */
347
NStringP
348
c_out_info_prefix PROTO_N ((info, prefix))
349
		  PROTO_T (COutputInfoP info X
350
			   CPrefixT     prefix)
351
{
352
    return (&(info->prefixes [prefix]));
353
}
354
#ifdef FS_FAST
355
#define c_out_info_prefix(o, i) (&((o)->prefixes [i]))
356
#endif /* defined (FS_FAST) */
357
 
358
#ifdef FS_FAST
359
#undef c_out_info_get_prototypes
360
#endif /* defined (FS_FAST) */
361
BoolT
362
c_out_info_get_prototypes PROTO_N ((info))
363
			  PROTO_T (COutputInfoP info)
364
{
365
    return (info->prototypes);
366
}
367
#ifdef FS_FAST
368
#define c_out_info_get_prototypes(o) ((o)->prototypes)
369
#endif /* defined (FS_FAST) */
370
 
371
#ifdef FS_FAST
372
#undef c_out_info_set_prototypes
373
#endif /* defined (FS_FAST) */
374
void
375
c_out_info_set_prototypes PROTO_N ((info, prototypes))
376
			  PROTO_T (COutputInfoP info X
377
				   BoolT        prototypes)
378
{
379
    info->prototypes = prototypes;
380
}
381
#ifdef FS_FAST
382
#define c_out_info_set_prototypes(o, b) ((o)->prototypes = (b))
383
#endif /* defined (FS_FAST) */
384
 
385
#ifdef FS_FAST
386
#undef c_out_info_get_ossg
387
#endif /* defined (FS_FAST) */
388
BoolT
389
c_out_info_get_ossg PROTO_N ((info))
390
		    PROTO_T (COutputInfoP info)
391
{
392
    return (info->ossg);
393
}
394
#ifdef FS_FAST
395
#define c_out_info_get_ossg(o) ((o)->ossg)
396
#endif /* defined (FS_FAST) */
397
 
398
#ifdef FS_FAST
399
#undef c_out_info_set_ossg
400
#endif /* defined (FS_FAST) */
401
void
402
c_out_info_set_ossg PROTO_N ((info, ossg))
403
		    PROTO_T (COutputInfoP info X
404
			     BoolT        ossg)
405
{
406
    info->ossg = ossg;
407
}
408
#ifdef FS_FAST
409
#define c_out_info_set_ossg(o, b) ((o)->ossg = (b))
410
#endif /* defined (FS_FAST) */
411
 
412
#ifdef FS_FAST
413
#undef c_out_info_get_numeric_ids
414
#endif /* defined (FS_FAST) */
415
BoolT
416
c_out_info_get_numeric_ids PROTO_N ((info))
417
			   PROTO_T (COutputInfoP info)
418
{
419
    return (info->numeric_ids);
420
}
421
#ifdef FS_FAST
422
#define c_out_info_get_numeric_ids(o) ((o)->numeric_ids)
423
#endif /* defined (FS_FAST) */
424
 
425
#ifdef FS_FAST
426
#undef c_out_info_set_numeric_ids
427
#endif /* defined (FS_FAST) */
428
void
429
c_out_info_set_numeric_ids PROTO_N ((info, numeric_ids))
430
			   PROTO_T (COutputInfoP info X
431
				    BoolT        numeric_ids)
432
{
433
    info->numeric_ids = numeric_ids;
434
}
435
#ifdef FS_FAST
436
#define c_out_info_set_numeric_ids(o, b) ((o)->numeric_ids = (b))
437
#endif /* defined (FS_FAST) */
438
 
439
#ifdef FS_FAST
440
#undef c_out_info_get_casts
441
#endif /* defined (FS_FAST) */
442
BoolT
443
c_out_info_get_casts PROTO_N ((info))
444
		     PROTO_T (COutputInfoP info)
445
{
446
    return (info->casts);
447
}
448
#ifdef FS_FAST
449
#define c_out_info_get_casts(o) ((o)->casts)
450
#endif /* defined (FS_FAST) */
451
 
452
#ifdef FS_FAST
453
#undef c_out_info_set_casts
454
#endif /* defined (FS_FAST) */
455
void
456
c_out_info_set_casts PROTO_N ((info, casts))
457
		     PROTO_T (COutputInfoP info X
458
			      BoolT        casts)
459
{
460
    info->casts = casts;
461
}
462
#ifdef FS_FAST
463
#define c_out_info_set_casts(o, b) ((o)->casts = (b))
464
#endif /* defined (FS_FAST) */
465
 
466
#ifdef FS_FAST
467
#undef c_out_info_get_unreachable
468
#endif /* defined (FS_FAST) */
469
BoolT
470
c_out_info_get_unreachable PROTO_N ((info))
471
    			   PROTO_T (COutputInfoP info)
472
{
473
    return (info->unreachable);
474
}
475
#ifdef FS_FAST
476
#define c_out_info_get_unreachable(o) ((o)->unreachable)
477
#endif /* defined (FS_FAST) */
478
 
479
#ifdef FS_FAST
480
#undef c_out_info_set_unreachable
481
#endif /* defined (FS_FAST) */
482
void
483
c_out_info_set_unreachable PROTO_N ((info, unreachable))
484
    			   PROTO_T (COutputInfoP info X
485
				    BoolT        unreachable)
486
{
487
    info->unreachable = unreachable;
488
}
489
#ifdef FS_FAST
490
#define c_out_info_set_unreachable(o, b) ((o)->unreachable = (b))
491
#endif /* defined (FS_FAST) */
492
 
493
#ifdef FS_FAST
494
#undef c_out_info_get_lines
495
#endif /* defined (FS_FAST) */
496
BoolT
497
c_out_info_get_lines PROTO_N ((info))
498
		     PROTO_T (COutputInfoP info)
499
{
500
    return (info->lines);
501
}
502
#ifdef FS_FAST
503
#define c_out_info_get_lines(o) ((o)->lines)
504
#endif /* defined (FS_FAST) */
505
 
506
#ifdef FS_FAST
507
#undef c_out_info_set_lines
508
#endif /* defined (FS_FAST) */
509
void
510
c_out_info_set_lines PROTO_N ((info, lines))
511
		     PROTO_T (COutputInfoP info X
512
			      BoolT        lines)
513
{
514
    info->lines = lines;
515
}
516
#ifdef FS_FAST
517
#define c_out_info_set_lines(o, b) ((o)->lines = (b))
518
#endif /* defined (FS_FAST) */
519
 
520
#ifdef FS_FAST
521
#undef c_out_info_get_split
522
#endif /* defined (FS_FAST) */
523
unsigned
524
c_out_info_get_split PROTO_N ((info))
525
		    PROTO_T (COutputInfoP info)
526
{
527
    return (info->split);
528
}
529
#ifdef FS_FAST
530
#define c_out_info_get_split(o) ((o)->split)
531
#endif /* defined (FS_FAST) */
532
 
533
#ifdef FS_FAST
534
#undef c_out_info_set_split
535
#endif /* defined (FS_FAST) */
536
void
537
c_out_info_set_split PROTO_N ((info, split))
538
		    PROTO_T (COutputInfoP info X
539
			     unsigned     split)
540
{
541
    info->split = split;
542
}
543
#ifdef FS_FAST
544
#define c_out_info_set_split(o, n) ((o)->split = (n))
545
#endif /* defined (FS_FAST) */
546
 
547
/*
548
 * Local variables(smf):
549
 * eval: (include::add-path-entry "../os-interface" "../library")
550
 * eval: (include::add-path-entry "../transforms" "../output" "../generated")
551
 * end:
552
**/