34 static char sccsid[] =
"@(#)io.c 8.1 (Berkeley) 6/6/93";
58 static int pad_output(
int current,
int target);
69 static int not_first_line;
117 if (
s_lab[0] ==
'#' && (strncmp(
s_lab,
"#else", 5) == 0
118 || strncmp(
s_lab,
"#endif", 6) == 0)) {
122 while (s <
e_lab &&
'a' <= *s && *s<=
'z');
123 while ((*s ==
' ' || *s ==
'\t') && s <
e_lab)
126 fprintf(
output, s[0]==
'/' && s[1]==
'*' ?
"\t%.*s" :
"\t/* %.*s */",
127 (
int)(
e_lab - s), s);
154 if (*p == (
char) 0200)
162 char *com_st =
s_com;
165 while (*com_st ==
'\t')
171 else if (*com_st ==
'\t')
175 if (cur_col > target) {
181 while (
e_com > com_st && isspace((
unsigned char)
e_com[-1]))
302 errx(1,
"too much lookahead required");
367 errx(1,
"input line too long");
375 if ((
i = getc(f)) == EOF) {
389 if (p -
in_buffer > 2 && p[-2] ==
'/' && p[-3] ==
'*') {
396 while (*p ==
' ' || *p ==
'\t')
398 if (*p ==
'/' && p[1] ==
'*') {
400 while (*p ==
' ' || *p ==
'\t')
402 if (p[0] ==
'I' && p[1] ==
'N' && p[2] ==
'D' && p[3] ==
'E'
403 && p[4] ==
'N' && p[5] ==
'T') {
405 while (*p ==
' ' || *p ==
'\t')
409 else if (*p ==
'O') {
412 else if (*p ==
'F' && *++p ==
'F')
415 while (*p ==
' ' || *p ==
'\t')
417 if (p[0] ==
'*' && p[1] ==
'/' && p[2] ==
'\n' && com) {
435 while (*p++ !=
'\n');
477 if (current >= target)
483 while ((tcur =
tabsize * (1 + (curr - 1) /
tabsize) + 1) <= target) {
490 while (curr++ < target)
556 diag4(
int level,
const char *msg,
int a,
int b)
566 fprintf(stderr,
"%s@%d: ", level == 0 ?
"Warning" :
"Error",
line_no);
583 fprintf(stderr,
"%s@%d: ", level == 0 ?
"Warning" :
"Error",
line_no);
600 fprintf(stderr,
"%s@%d: ", level == 0 ?
"Warning" :
"Error",
line_no);
void errx(int eval, const char *fmt,...)
int blanklines_after_declarations
int postfix_blankline_requested
int prefix_blankline_requested
int swallow_optional_blanklines
int lineup_to_parens_always
static char * lookahead_buf_end
static char * lookahead_bp_save
int compute_code_target(void)
void diag3(int level, const char *msg, int a)
int compute_label_target(void)
int count_spaces(int cur, char *buffer)
int count_spaces_until(int cur, char *buffer, char *end)
static char * lookahead_start
static char * lookahead_buf
void diag2(int level, const char *msg)
static int pad_output(int current, int target)
void lookahead_reset(void)
void diag4(int level, const char *msg, int a, int b)
static char * lookahead_ptr
static char * lookahead_end
static pg_noinline void Size size