Moved ttyfree() to ifdef broken. See my reply on the sio change.
[unix-history] / usr.bin / f2c / output.h
CommitLineData
f1525c23
WH
1/* nice_printf -- same arguments as fprintf.
2
3 All output which is to become C code must be directed through this
4 function. For now, no buffering is done. Later on, every line of
5 output will be filtered to accomodate the style definitions (e.g. one
6 statement per line, spaces between function names and argument lists,
7 etc.)
8*/
9#include "niceprintf.h"
10
11extern int nice_printf ();
12
13
14/* Definitions for the opcode table. The table is indexed by the macros
15 which are #defined in defines.h */
16
17#define UNARY_OP 01
18#define BINARY_OP 02
19
20#define SPECIAL_FMT NULL
21
22#define is_unary_op(x) (opcode_table[x].type == UNARY_OP)
23#define is_binary_op(x) (opcode_table[x].type == BINARY_OP)
24#define op_precedence(x) (opcode_table[x].prec)
25#define op_format(x) (opcode_table[x].format)
26
27/* _assoc_table -- encodes left-associativity and right-associativity
28 information; indexed by precedence level. Only 2, 3, 14 are
29 right-associative. Source: Kernighan & Ritchie, p. 49 */
30
31extern char _assoc_table[];
32
33#define is_right_assoc(x) (_assoc_table [x])
34#define is_left_assoc(x) (! _assoc_table [x])
35
36
37typedef struct {
38 int type; /* UNARY_OP or BINARY_OP */
39 int prec; /* Precedence level, useful for adjusting
40 number of parens to insert. Zero is a
41 special level, and 2, 3, 14 are
42 right-associative */
43 char *format;
44} table_entry;
45
46
47extern char *fl_fmt_string; /* Float constant format string */
48extern char *db_fmt_string; /* Double constant format string */
49extern char *cm_fmt_string; /* Complex constant format string */
50extern char *dcm_fmt_string; /* Double Complex constant format string */
51
52extern int indent; /* Number of spaces to indent; this is a
53 temporary fix */
54extern int tab_size; /* Number of spaces in each tab */
55extern int in_string;
56
57extern table_entry opcode_table[];
58
59
60void expr_out (), out_init (), out_addr (), out_const ();
61void out_name (), extern_out (), out_asgoto ();
62void out_if (), out_else (), elif_out ();
63void endif_out (), end_else_out ();
64void compgoto_out (), out_for ();
65void out_end_for (), out_and_free_statement ();