1: /* indent_globs.h 4.2 83/08/11 */
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:
13: FILE NAME:
14: indent_globs.h
15:
16: PURPOSE:
17: This include file contains the declarations for all global variables
18: used in indent.
19:
20: GLOBALS:
21: The names of all of the variables will not be repeated here. The
22: declarations start on the next page.
23:
24: FUNCTIONS:
25: None
26: */
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:
59: int input; /* the fid for the input file */
60: int output; /* the fid for the output file */
61:
62: char labbuf[bufsize];
63: /* buffer for label */
64: char *s_lab; /* start ... */
65: char *e_lab; /* .. and end of stored label */
66:
67: char codebuf[bufsize];
68: /* buffer for code section */
69: char *s_code; /* start ... */
70: char *e_code; /* .. and end of stored code */
71:
72: char combuf[bufsize];
73: /* buffer for comments */
74: char *s_com; /* start ... */
75: char *e_com; /* ... and end of stored comments */
76:
77: char in_buffer[inp_bufs];
78: /* input buffer */
79: char *buf_ptr; /* ptr to next character to be taken from in_buffer */
80: char *buf_end; /* ptr to first after last char in in_buffer */
81:
82: char save_com[sc_size];
83: /* input text is saved here when looking for the brace
84: after an if, while, etc */
85: char *sc_end; /* pointer into save_com buffer */
86:
87: char *bp_save; /* saved value of buf_ptr when taking input from
88: save_com */
89: char *be_save; /* similarly saved value of buf_end */
90:
91: char token[bufsize];
92: /* the last token scanned */
93:
94:
95:
96:
97: int bl_line; /* set to 1 by dump_line if the line is blank */
98: int break_comma;
99: /* when true and not in parens, break after a comma */
100: int btype_2; /* when true, brace should be on same line as if,
101: while, etc */
102: int case_ind; /* indentation level to be used for a "case n:" */
103: int code_lines;/* count of lines with code */
104: int col_1; /* set to true if the last token started in column 1 */
105: int com_col; /* this is the column in which the current coment
106: should start */
107: int com_ind; /* the column in which comments to the right of code
108: should start */
109: int com_lines; /* the number of lines with comments, set by dump_line
110: */
111: int dec_nest; /* current nesting level for structure or init */
112: int decl_com_ind;
113: /* the column in which comments after declarations
114: should be put */
115: int decl_on_line;
116: /* set to true if this line of code has part of a
117: declaration on it */
118: int had_eof; /* set to true when input is exhausted */
119: int i_l_follow;/* the level to which ind_level should be set after the
120: current line is printed */
121: int in_decl; /* set to true when we are in a declaration stmt. The
122: processing of braces is then slightly different */
123: int in_stmt; /* set to 1 while in a stmt */
124: int ind_level; /* the current indentation level */
125: int ind_size; /* the size of one indentation level */
126: int 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 */
129: int last_u_d; /* set to true after scanning a token which forces a
130: following operator to be unary */
131: int leave_comma;
132: /* if true, never break declarations after commas */
133: int line_no; /* the current line number. */
134: int ljust_decl;/* true if declarations should be left justified */
135: int max_col; /* the maximum allowable line length */
136: int out_coms; /* the number of comments processed, set by pr_comment
137: */
138: int out_lines; /* the number of lines written, set by dump_line */
139: int p_l_follow;/* used to remember how to indent following statement
140: */
141: int paren_level;
142: /* parenthesization level. used to indent within stmts
143: */
144: int pcase; /* set to 1 if the current line label is a case. It is
145: printed differently from a regular label */
146: int 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 */
150: int unindent_displace;
151: /* comments not to the right of code will be placed
152: this many indentation levels to the left of code */
153: int use_ff; /* set to one if the current line should be terminated
154: with a form feed */
155: int verbose; /* when true, non-essential error messages are printed
156: */
Defined variables
btype_2
defined in line
100; used 13 times
- in /usr/src/ucb/indent/indent.c line
254,
355,
495,
521,
624,
765,
1097-1100(2)
- in /usr/src/ucb/indent/parse.c line
131,
158,
198,
215,
240
buf_end
defined in line
80; used 31 times
- in /usr/src/ucb/indent/indent.c line
220,
400,
406,
432,
451,
947,
959
- in /usr/src/ucb/indent/io.c line
272-274(2),
281-287(3)
- in /usr/src/ucb/indent/lexi.c line
158,
171,
250,
280,
297,
394,
410,
425,
436,
452
- in /usr/src/ucb/indent/pr_comment.c line
164-169(2),
195-200(2),
226,
245,
253,
264,
302
buf_ptr
defined in line
79; used 76 times
- in /usr/src/ucb/indent/indent.c line
220,
398-401(2),
431-435(3),
451,
945-950(4),
959
- in /usr/src/ucb/indent/io.c line
270-274(2),
282
- in /usr/src/ucb/indent/lexi.c line
154-158(3),
166-171(4),
247-250(2),
272,
279-280(2),
291-297(3),
371-373(2),
382-384(3),
390-394(3),
408-415(7),
421-425(2),
433-436(4),
452
- in /usr/src/ucb/indent/pr_comment.c line
119,
139,
153,
164-169(4),
195-200(4),
226-228(3),
245-247(3),
253,
262-264(2),
297-302(4)
e_code
defined in line
70; used 58 times
- in /usr/src/ucb/indent/indent.c line
217,
464,
537-541(4),
577-583(4),
603-607(2),
631,
638-644(3),
652-654(2),
660-661(2),
670-671(2),
679-681(2),
690-691(2),
701,
721-724(3),
745,
765,
785,
801-803(2),
814,
821,
850,
876,
885-889(3),
904-906(2),
912,
919-926(4),
937,
985
- in /usr/src/ucb/indent/io.c line
138,
162,
168,
201
- in /usr/src/ucb/indent/parse.c line
169
- in /usr/src/ucb/indent/pr_comment.c line
122,
209
e_com
defined in line
75; used 48 times
- in /usr/src/ucb/indent/indent.c line
218,
465,
535,
543,
935
- in /usr/src/ucb/indent/io.c line
176,
184,
202
- in /usr/src/ucb/indent/pr_comment.c line
137-142(4),
160-162(3),
171,
179,
186,
222,
232-238(5),
267-269(2),
275,
281-284(3),
290,
301-309(3),
315-319(4),
325-339(7),
346-350(3)
e_lab
defined in line
65; used 21 times
i_l_follow
defined in line
119; used 22 times
- in /usr/src/ucb/indent/indent.c line
467-468(2),
781
- in /usr/src/ucb/indent/io.c line
204
- in /usr/src/ucb/indent/parse.c line
138,
147,
156-157(2),
166,
184,
190-197(4),
211,
223,
236-239(3),
349,
364,
382
ind_level
defined in line
124; used 21 times
- in /usr/src/ucb/indent/indent.c line
781
- in /usr/src/ucb/indent/io.c line
133,
149,
163,
204
- in /usr/src/ucb/indent/parse.c line
142-147(3),
156,
171-174(2),
181,
190-192(2),
209-211(2),
223,
247
- in /usr/src/ucb/indent/pr_comment.c line
128-133(2),
212
input
defined in line
59; used 13 times
last_u_d
defined in line
129; used 15 times
- in /usr/src/ucb/indent/indent.c line
615,
897
- in /usr/src/ucb/indent/lexi.c line
181-185(2),
204,
236,
255,
321,
351,
368,
376,
416,
429,
441,
454
line_no
defined in line
133; used 27 times
- in /usr/src/ucb/indent/indent.c line
221,
341,
379,
387,
422,
442,
524,
568,
600,
734,
768,
775,
809,
817,
853,
939
- in /usr/src/ucb/indent/io.c line
174,
189
- in /usr/src/ucb/indent/lexi.c line
274,
293
- in /usr/src/ucb/indent/parse.c line
206,
227,
251
- in /usr/src/ucb/indent/pr_comment.c line
188,
220,
242,
324
output
defined in line
60; used 19 times
- in /usr/src/ucb/indent/indent.c line
238,
274,
281-282(2),
301,
481,
1031-1032(2),
1104(2)
- in /usr/src/ucb/indent/io.c line
152,
168-173(2),
179-187(3),
196-198(2),
362
s_code
defined in line
69; used 27 times
- in /usr/src/ucb/indent/indent.c line
217,
464,
580,
603,
638,
698-701(2),
721-723(2),
765,
785,
814,
850,
876,
888,
919-923(2),
937
- in /usr/src/ucb/indent/io.c line
138,
162,
168-169(3),
201
- in /usr/src/ucb/indent/parse.c line
169
- in /usr/src/ucb/indent/pr_comment.c line
122,
209
s_com
defined in line
74; used 14 times
s_lab
defined in line
64; used 11 times
sc_end
defined in line
85; used 19 times
token
defined in line
91; used 26 times
- in /usr/src/ucb/indent/indent.c line
391,
574,
583-585(2),
600,
607,
636,
643,
653,
660-661(2),
680,
843-844(2),
860,
870,
905
- in /usr/src/ucb/indent/lexi.c line
148,
194,
253,
282,
371,
400(2),
421
- in /usr/src/ucb/indent/parse.c line
118
Defined macros
false
defined in line
55; used 68 times
- in /usr/src/ucb/indent/indent.c line
222-231(5),
334,
351,
371,
378,
388,
396,
525-529(3),
542,
549,
563,
569,
584,
591,
612-617(2),
646,
696,
710-717(4),
739,
760,
770,
779,
786,
794,
802,
811,
823,
849,
855,
886,
895-898(2),
914,
962,
974,
1079,
1085,
1091,
1100
- in /usr/src/ucb/indent/io.c line
155-160(2),
170,
191,
199,
499-501(2)
- in /usr/src/ucb/indent/lexi.c line
149-156(3),
179,
185,
198,
362,
378,
448
- in /usr/src/ucb/indent/parse.c line
162,
244
- in /usr/src/ucb/indent/pr_comment.c line
102
true
defined in line
56; used 59 times
- in /usr/src/ucb/indent/indent.c line
225,
342,
367,
532,
560,
608-615(3),
656,
662,
672-676(2),
682,
692,
746,
753,
762,
822,
828,
835,
841,
858,
867-869(2),
896-897(2),
907,
929,
965,
1076,
1082,
1088,
1097
- in /usr/src/ucb/indent/io.c line
130,
285,
504
- in /usr/src/ucb/indent/lexi.c line
125,
181,
195,
204,
212,
236,
256,
311,
326,
332-346(4),
352-357(2),
369,
399,
417,
442
- in /usr/src/ucb/indent/parse.c line
135
- in /usr/src/ucb/indent/pr_comment.c line
115-120(2),
156
Usage of this include