must setparity even in cumode
[unix-history] / usr / src / usr.bin / indent / indent_globs.h
CommitLineData
84262df4
KM
1/* @(#)indent_globs.h 4.1 (Berkeley) %G% */
2
3/*
4
5 Copyright (C) 1976
6 by the
7 Board of Trustees
8 of the
9 University of Illinois
10
11 All rights reserved
12
13FILE NAME:
14 indent_globs.h
15
16PURPOSE:
17 This include file contains the declarations for all global variables
18 used in indent.
19
20GLOBALS:
21 The names of all of the variables will not be repeated here. The
22 declarations start on the next page.
23
24FUNCTIONS:
25 None
26*/\f
27#define bufsize 600/* size of internal buffers */
28#define inp_bufs 512
29 /* size of input buffer */
30#define sc_size 5000
31 /* size of save_com buffer */
32#define label_offset 2
33 /* number of levels a label is placed to left of code
34 */
35
36#define d_ljust 0 /* default for ljust_decl */
37#define d_max_col 75
38 /* default for max_col */
39#define d_com_ind 33
40 /* default com_ind */
41#define d_ind_size 4
42 /* default ind_size */
43#define d_verbose 0/* default verbose */
44#define d_unindent 1
45 /* default value for unindent_displace */
46#define d_leave_comma 0
47 /* default value for leave_comma */
48#define d_btype_2 1/* default value for btype_2 */
49
50#define tabsize 8 /* the size of a tab */
51#define tabmask 0177770
52 /* mask used when figuring length of lines with tabs */
53
54
55#define false 0
56#define true 1
57
58
59int input; /* the fid for the input file */
60int output; /* the fid for the output file */
61
62char labbuf[bufsize];
63 /* buffer for label */
64char *s_lab; /* start ... */
65char *e_lab; /* .. and end of stored label */
66
67char codebuf[bufsize];
68 /* buffer for code section */
69char *s_code; /* start ... */
70char *e_code; /* .. and end of stored code */
71
72char combuf[bufsize];
73 /* buffer for comments */
74char *s_com; /* start ... */
75char *e_com; /* ... and end of stored comments */
76
77char in_buffer[inp_bufs];
78 /* input buffer */
79char *buf_ptr; /* ptr to next character to be taken from in_buffer */
80char *buf_end; /* ptr to first after last char in in_buffer */
81
82char save_com[sc_size];
83 /* input text is saved here when looking for the brace
84 after an if, while, etc */
85char *sc_end; /* pointer into save_com buffer */
86
87char *bp_save; /* saved value of buf_ptr when taking input from
88 save_com */
89char *be_save; /* similarly saved value of buf_end */
90
91char token[bufsize];
92 /* the last token scanned */
93
94
95
96
97int bl_line; /* set to 1 by dump_line if the line is blank */
98int break_comma;
99 /* when true and not in parens, break after a comma */
100int btype_2; /* when true, brace should be on same line as if,
101 while, etc */
102int case_ind; /* indentation level to be used for a "case n:" */
103int code_lines;/* count of lines with code */
104int col_1; /* set to true if the last token started in column 1 */
105int com_col; /* this is the column in which the current coment
106 should start */
107int com_ind; /* the column in which comments to the right of code
108 should start */
109int com_lines; /* the number of lines with comments, set by dump_line
110 */
111int dec_nest; /* current nesting level for structure or init */
112int decl_com_ind;
113 /* the column in which comments after declarations
114 should be put */
115int decl_on_line;
116 /* set to true if this line of code has part of a
117 declaration on it */
118int had_eof; /* set to true when input is exhausted */
119int i_l_follow;/* the level to which ind_level should be set after the
120 current line is printed */
121int in_decl; /* set to true when we are in a declaration stmt. The
122 processing of braces is then slightly different */
123int in_stmt; /* set to 1 while in a stmt */
124int ind_level; /* the current indentation level */
125int ind_size; /* the size of one indentation level */
126int ind_stmt; /* set to 1 if next line should have an extra
127 indentation level because we are in the middle of a
128 stmt */
129int last_u_d; /* set to true after scanning a token which forces a
130 following operator to be unary */
131int leave_comma;
132 /* if true, never break declarations after commas */
133int line_no; /* the current line number. */
134int ljust_decl;/* true if declarations should be left justified */
135int max_col; /* the maximum allowable line length */
136int out_coms; /* the number of comments processed, set by pr_comment
137 */
138int out_lines; /* the number of lines written, set by dump_line */
139int p_l_follow;/* used to remember how to indent following statement
140 */
141int paren_level;
142 /* parenthesization level. used to indent within stmts
143 */
144int pcase; /* set to 1 if the current line label is a case. It is
145 printed differently from a regular label */
146int search_brace;
147 /* set to true by parse when it is necessary to buffer
148 up all info up to the start of a stmt after an if,
149 while, etc */
150int unindent_displace;
151 /* comments not to the right of code will be placed
152 this many indentation levels to the left of code */
153int use_ff; /* set to one if the current line should be terminated
154 with a form feed */
155int verbose; /* when true, non-essential error messages are printed
156 */