2 * Copyright (c) 2014 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
4 * Copyright (C) 1989 - 1992, 2000 - 2005, 2007, 2008
5 * Free Software Foundation, Inc.
6 * Written by James Clark (jjc@jclark.com)
8 * This is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License as published by the Free
10 * Software Foundation; either version 2, or (at your option) any later
13 * This is distributed in the hope that it will be useful, but WITHOUT ANY
14 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * You should have received a copy of the GNU General Public License along
19 * with groff; see the file COPYING. If not, write to the Free Software
20 * Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
24 #include "tbl-config.h"
26 #include "file_case.h"
30 int compatible_flag
= 0;
36 REREAD_T
, REREAD_TE
, REREAD_E
,
37 LEADER_1
, LEADER_2
, LEADER_3
, LEADER_4
,
42 table_input(file_case
*);
44 int ended() { return unget_stack
.empty() && state
== END
; }
48 table_input::table_input(file_case
*fcp
)
49 : _fcp(fcp
), state(START
)
53 void table_input::unget(char c
)
61 int table_input::get()
63 int len
= unget_stack
.length();
65 unsigned char c
= unget_stack
[len
- 1];
66 unget_stack
.set_length(len
- 1);
75 if ((c
= _fcp
->get_c()) == '.') {
76 if ((c
= _fcp
->get_c()) == 'T') {
77 if ((c
= _fcp
->get_c()) == 'E') {
78 if (compatible_flag
) {
86 if (c
== EOF
|| c
== ' ' || c
== '\n') {
118 error("invalid input character code 0");
126 // handle line continuation and uninterpreted leader character
127 if ((c
= _fcp
->get_c()) == '\\') {
130 c
= _fcp
->get_c(); // perhaps state ought to be START now
131 else if (c
== 'a' && compatible_flag
) {
150 else if (c
== '\0') {
151 error("invalid input character code 0");
184 void process_input_file(file_case
*);
185 void process_table(table_input
&in
);
187 void process_input_file(file_case
*fcp
)
189 enum { START
, MIDDLE
, HAD_DOT
, HAD_T
, HAD_TS
, HAD_l
, HAD_lf
} state
;
192 while ((c
= fcp
->get_c()) != EOF
)
244 if (c
== ' ' || c
== '\n' || compatible_flag
) {
250 error("end of file at beginning of table");
259 table_input
input(fcp
);
260 process_table(input
);
261 set_troff_location(current_filename
, current_lineno
);
263 fputs(".TE", stdout
);
264 while ((c
= fcp
->get_c()) != '\n') {
278 fputs(".TS", stdout
);
299 if (c
== ' ' || c
== '\n' || compatible_flag
) {
310 interpret_lf_args(line
.contents());
311 printf(".lf%s", line
.contents());
315 fputs(".lf", stdout
);
330 fputs(".\n", stdout
);
333 fputs(".l\n", stdout
);
336 fputs(".T\n", stdout
);
339 fputs(".lf\n", stdout
);
342 fputs(".TS\n", stdout
);
354 char decimal_point_char
;
360 : flags(0), linesize(0), tab_char('\t'), decimal_point_char('.')
362 delim
[0] = delim
[1] = '\0';
365 // Return non-zero if p and q are the same ignoring case.
367 int strieq(const char *p
, const char *q
)
369 for (; cmlower(*p
) == cmlower(*q
); p
++, q
++)
375 // return 0 if we should give up in this table
377 options
*process_options(table_input
&in
)
379 options
*opt
= new options
;
385 int i
= line
.length();
392 int i
= line
.length();
401 else if (c
== ';' && level
== 0) {
411 while (!csalpha(*p
) && *p
!= '\0')
419 if (*q
!= '(' && *q
!= '\0')
426 while (*q
!= ')' && *q
!= '\0')
429 error("missing `)'");
435 error("argument without option");
437 else if (strieq(p
, "tab")) {
439 error("`tab' option requires argument in parentheses");
441 if (arg
[0] == '\0' || arg
[1] != '\0')
442 error("argument to `tab' option must be a single character");
444 opt
->tab_char
= arg
[0];
447 else if (strieq(p
, "linesize")) {
449 error("`linesize' option requires argument in parentheses");
451 if (sscanf(arg
, "%d", &opt
->linesize
) != 1)
452 error("bad linesize `%s'", arg
);
453 else if (opt
->linesize
<= 0) {
454 error("linesize must be positive");
459 else if (strieq(p
, "delim")) {
461 error("`delim' option requires argument in parentheses");
462 else if (arg
[0] == '\0' || arg
[1] == '\0' || arg
[2] != '\0')
463 error("argument to `delim' option must be two characters");
465 opt
->delim
[0] = arg
[0];
466 opt
->delim
[1] = arg
[1];
469 else if (strieq(p
, "center") || strieq(p
, "centre")) {
471 error("`center' option does not take an argument");
472 opt
->flags
|= table::CENTER
;
474 else if (strieq(p
, "expand")) {
476 error("`expand' option does not take an argument");
477 opt
->flags
|= table::EXPAND
;
479 else if (strieq(p
, "box") || strieq(p
, "frame")) {
481 error("`box' option does not take an argument");
482 opt
->flags
|= table::BOX
;
484 else if (strieq(p
, "doublebox") || strieq(p
, "doubleframe")) {
486 error("`doublebox' option does not take an argument");
487 opt
->flags
|= table::DOUBLEBOX
;
489 else if (strieq(p
, "allbox")) {
491 error("`allbox' option does not take an argument");
492 opt
->flags
|= table::ALLBOX
;
494 else if (strieq(p
, "nokeep")) {
496 error("`nokeep' option does not take an argument");
497 opt
->flags
|= table::NOKEEP
;
499 else if (strieq(p
, "nospaces")) {
501 error("`nospaces' option does not take an argument");
502 opt
->flags
|= table::NOSPACES
;
504 else if (strieq(p
, "decimalpoint")) {
506 error("`decimalpoint' option requires argument in parentheses");
508 if (arg
[0] == '\0' || arg
[1] != '\0')
509 error("argument to `decimalpoint' option must be a single character");
511 opt
->decimal_point_char
= arg
[0];
514 else if (strieq(p
, "experimental")) {
515 opt
->flags
|= table::EXPERIMENTAL
;
518 error("unrecognised global option `%1'", p
);
527 entry_modifier::entry_modifier()
528 : vertical_alignment(CENTER
), zero_width(0), stagger(0)
530 vertical_spacing
.inc
= vertical_spacing
.val
= 0;
531 point_size
.inc
= point_size
.val
= 0;
534 entry_modifier::~entry_modifier()
538 entry_format::entry_format() : type(FORMAT_LEFT
)
542 entry_format::entry_format(format_type t
) : type(t
)
546 void entry_format::debug_print() const
561 case FORMAT_ALPHABETIC
:
573 case FORMAT_DOUBLE_HLINE
:
580 if (point_size
.val
!= 0) {
582 if (point_size
.inc
> 0)
584 else if (point_size
.inc
< 0)
586 fprintf(stderr
, "%d ", point_size
.val
);
588 if (vertical_spacing
.val
!= 0) {
590 if (vertical_spacing
.inc
> 0)
592 else if (vertical_spacing
.inc
< 0)
594 fprintf(stderr
, "%d ", vertical_spacing
.val
);
598 put_string(font
, stderr
);
601 if (!macro
.empty()) {
603 put_string(macro
, stderr
);
606 switch (vertical_alignment
) {
607 case entry_modifier::CENTER
:
609 case entry_modifier::TOP
:
612 case entry_modifier::BOTTOM
:
631 entry_format
**entry
;
634 format(int nr
, int nc
);
636 void add_rows(int n
);
639 format::format(int nr
, int nc
) : nrows(nr
), ncolumns(nc
)
642 separation
= ncolumns
> 1 ? new int[ncolumns
- 1] : 0;
643 for (i
= 0; i
< ncolumns
-1; i
++)
645 width
= new string
[ncolumns
];
646 equal
= new char[ncolumns
];
647 expand
= new char[ncolumns
];
648 for (i
= 0; i
< ncolumns
; i
++) {
652 entry
= new entry_format
*[nrows
];
653 for (i
= 0; i
< nrows
; i
++)
654 entry
[i
] = new entry_format
[ncolumns
];
655 vline
= new char*[nrows
];
656 for (i
= 0; i
< nrows
; i
++) {
657 vline
[i
] = new char[ncolumns
+1];
658 for (int j
= 0; j
< ncolumns
+1; j
++)
663 void format::add_rows(int n
)
666 char **old_vline
= vline
;
667 vline
= new char*[nrows
+ n
];
668 for (i
= 0; i
< nrows
; i
++)
669 vline
[i
] = old_vline
[i
];
671 for (i
= 0; i
< n
; i
++) {
672 vline
[nrows
+ i
] = new char[ncolumns
+ 1];
673 for (int j
= 0; j
< ncolumns
+ 1; j
++)
674 vline
[nrows
+ i
][j
] = 0;
676 entry_format
**old_entry
= entry
;
677 entry
= new entry_format
*[nrows
+ n
];
678 for (i
= 0; i
< nrows
; i
++)
679 entry
[i
] = old_entry
[i
];
681 for (i
= 0; i
< n
; i
++)
682 entry
[nrows
+ i
] = new entry_format
[ncolumns
];
689 ad_delete(ncolumns
) width
;
692 for (int i
= 0; i
< nrows
; i
++) {
694 ad_delete(ncolumns
) entry
[i
];
700 class input_entry_format
701 : public entry_format
704 input_entry_format
*next
;
713 input_entry_format(format_type
, input_entry_format
* = 0);
714 ~input_entry_format();
718 input_entry_format::input_entry_format(format_type t
, input_entry_format
*p
)
719 : entry_format(t
), next(p
)
729 input_entry_format::~input_entry_format()
733 void free_input_entry_format_list(input_entry_format
*list
)
736 input_entry_format
*tem
= list
;
742 void input_entry_format::debug_print()
745 for (i
= 0; i
< pre_vline
; i
++)
747 entry_format::debug_print();
748 if (!width
.empty()) {
751 put_string(width
, stderr
);
759 fprintf(stderr
, "%d", separation
);
760 for (i
= 0; i
< vline
; i
++)
766 // Return zero if we should give up on this table.
767 // If this is a continuation format line, current_format will be the current
770 format
*process_format(table_input
&in
, options
*opt
,
771 format
*current_format
= 0)
773 input_entry_format
*list
= 0;
780 format_type t
= FORMAT_LEFT
;
783 error("end of input while processing format");
784 free_input_entry_format_list(list
);
796 t
= FORMAT_ALPHABETIC
;
823 case '-': // tbl also accepts this
829 t
= FORMAT_DOUBLE_HLINE
;
842 if (c
== opt
->tab_char
)
844 error("unrecognised format `%1'", char(c
));
845 free_input_entry_format_list(list
);
856 list
= new input_entry_format(t
, list
);
858 list
->pre_vline
= pre_vline
;
875 w
= w
*10 + (c
- '0');
877 } while (c
!= EOF
&& csdigit(c
));
878 list
->separation
= w
;
889 list
->vertical_alignment
= entry_modifier::BOTTOM
;
895 // `e' and `x' are mutually exclusive
902 } while (c
== ' ' || c
== '\t');
904 error("missing font name");
910 if (c
== EOF
|| c
== ' ' || c
== '\t') {
911 error("missing `)'");
918 list
->font
+= char(c
);
926 && c
!= EOF
&& c
!= ' ' && c
!= '\t' && c
!= '.' && c
!= '\n') {
927 list
->font
+= char(c
);
941 } while (c
== ' ' || c
== '\t');
943 error("missing macro name");
949 if (c
== EOF
|| c
== ' ' || c
== '\t') {
950 error("missing `)'");
957 list
->macro
+= char(c
);
965 && c
!= EOF
&& c
!= ' ' && c
!= '\t' && c
!= '.' && c
!= '\n') {
966 list
->macro
+= char(c
);
974 list
->point_size
.val
= 0;
975 list
->point_size
.inc
= 0;
976 if (c
== '+' || c
== '-') {
977 list
->point_size
.inc
= (c
== '+' ? 1 : -1);
980 if (c
== EOF
|| !csdigit(c
)) {
981 error("`p' modifier must be followed by number");
982 list
->point_size
.inc
= 0;
986 list
->point_size
.val
*= 10;
987 list
->point_size
.val
+= c
- '0';
989 } while (c
!= EOF
&& csdigit(c
));
991 if (list
->point_size
.val
> MAX_POINT_SIZE
992 || list
->point_size
.val
< -MAX_POINT_SIZE
) {
993 error("unreasonable point size");
994 list
->point_size
.val
= 0;
995 list
->point_size
.inc
= 0;
1001 list
->vertical_alignment
= entry_modifier::TOP
;
1011 list
->vertical_spacing
.val
= 0;
1012 list
->vertical_spacing
.inc
= 0;
1013 if (c
== '+' || c
== '-') {
1014 list
->vertical_spacing
.inc
= (c
== '+' ? 1 : -1);
1017 if (c
== EOF
|| !csdigit(c
)) {
1018 error("`v' modifier must be followed by number");
1019 list
->vertical_spacing
.inc
= 0;
1023 list
->vertical_spacing
.val
*= 10;
1024 list
->vertical_spacing
.val
+= c
- '0';
1026 } while (c
!= EOF
&& csdigit(c
));
1028 if (list
->vertical_spacing
.val
> MAX_VERTICAL_SPACING
1029 || list
->vertical_spacing
.val
< -MAX_VERTICAL_SPACING
) {
1030 error("unreasonable vertical spacing");
1031 list
->vertical_spacing
.val
= 0;
1032 list
->vertical_spacing
.inc
= 0;
1038 while (c
== ' ' || c
== '\t')
1044 if (c
== EOF
|| c
== '\n') {
1045 error("missing `)'");
1046 free_input_entry_format_list(list
);
1055 if (c
== '+' || c
== '-') {
1056 list
->width
= char(c
);
1061 if (c
== EOF
|| !csdigit(c
))
1062 error("bad argument for `w' modifier");
1065 list
->width
+= char(c
);
1067 } while (c
!= EOF
&& csdigit(c
));
1070 // `w' and `x' are mutually exclusive
1077 // `x' and `e' are mutually exclusive
1079 // `x' and `w' are mutually exclusive
1085 list
->zero_width
= 1;
1096 if (c
== opt
->tab_char
)
1103 if (list
->vline
> 2) {
1105 error("more than 2 vertical bars between key letters");
1107 if (c
== '\n' || c
== ',') {
1109 list
->last_column
= 1;
1115 } while (c
== ' ' || c
== '\t');
1117 error("`.' not last character on line");
1118 free_input_entry_format_list(list
);
1124 free_input_entry_format_list(list
);
1127 list
->last_column
= 1;
1128 // now reverse the list so that the first row is at the beginning
1129 input_entry_format
*rev
= 0;
1131 input_entry_format
*tem
= list
->next
;
1137 input_entry_format
*tem
;
1140 for (tem
= list
; tem
; tem
= tem
->next
)
1144 // compute number of columns and rows
1148 for (tem
= list
; tem
; tem
= tem
->next
) {
1149 if (tem
->last_column
) {
1150 if (col
>= ncolumns
)
1160 if (current_format
) {
1161 if (ncolumns
> current_format
->ncolumns
) {
1162 error("cannot increase the number of columns in a continued format");
1163 free_input_entry_format_list(list
);
1171 f
= new format(nrows
, ncolumns
);
1175 for (tem
= list
; tem
; tem
= tem
->next
) {
1176 f
->entry
[row
][col
] = *tem
;
1177 if (col
< ncolumns
- 1) {
1178 // use the greatest separation
1179 if (tem
->separation
> f
->separation
[col
]) {
1181 error("cannot change column separation in continued format");
1183 f
->separation
[col
] = tem
->separation
;
1186 else if (tem
->separation
>= 0)
1187 error("column separation specified for last column");
1188 if (tem
->equal
&& !f
->equal
[col
]) {
1190 error("cannot change which columns are equal in continued format");
1194 if (tem
->expand
&& !f
->expand
[col
]) {
1196 error("cannot change which columns are expanded in continued format");
1202 if (!tem
->width
.empty()) {
1203 // use the last width
1204 if (!f
->width
[col
].empty() && f
->width
[col
] != tem
->width
)
1205 error("multiple widths for column %1", col
+ 1);
1206 f
->width
[col
] = tem
->width
;
1208 if (tem
->pre_vline
) {
1210 f
->vline
[row
][col
] = tem
->pre_vline
;
1212 f
->vline
[row
][col
+ 1] = tem
->vline
;
1213 if (tem
->last_column
) {
1220 free_input_entry_format_list(list
);
1221 for (col
= 0; col
< ncolumns
; col
++) {
1222 entry_format
*e
= f
->entry
[f
->nrows
- 1] + col
;
1223 if (e
->type
!= FORMAT_HLINE
1224 && e
->type
!= FORMAT_DOUBLE_HLINE
1225 && e
->type
!= FORMAT_SPAN
)
1228 if (col
>= ncolumns
) {
1229 error("last row of format is all lines");
1233 if (have_expand
&& (opt
->flags
& table::EXPAND
)) {
1234 error("ignoring global `expand' option because of `x' specifiers");
1235 opt
->flags
&= ~table::EXPAND
;
1240 table
*process_data(table_input
&in
, format
*f
, options
*opt
)
1242 char tab_char
= opt
->tab_char
;
1243 int ncolumns
= f
->ncolumns
;
1244 int current_row
= 0;
1245 int format_index
= 0;
1247 enum { DATA_INPUT_LINE
, TROFF_INPUT_LINE
, SINGLE_HLINE
, DOUBLE_HLINE
} type
;
1248 table
*tbl
= new table(ncolumns
, opt
->flags
, opt
->linesize
,
1249 opt
->decimal_point_char
);
1250 if (opt
->delim
[0] != '\0')
1251 tbl
->set_delim(opt
->delim
[0], opt
->delim
[1]);
1253 // first determine what type of line this is
1259 if (d
!= EOF
&& csdigit(d
)) {
1261 type
= DATA_INPUT_LINE
;
1265 type
= TROFF_INPUT_LINE
;
1268 else if (c
== '_' || c
== '=') {
1272 type
= SINGLE_HLINE
;
1274 type
= DOUBLE_HLINE
;
1278 type
= DATA_INPUT_LINE
;
1282 type
= DATA_INPUT_LINE
;
1285 case DATA_INPUT_LINE
:
1288 if (format_index
>= f
->nrows
)
1289 format_index
= f
->nrows
- 1;
1290 // A format row that is all lines doesn't use up a data line.
1291 while (format_index
< f
->nrows
- 1) {
1293 for (cnt
= 0; cnt
< ncolumns
; cnt
++) {
1294 entry_format
*e
= f
->entry
[format_index
] + cnt
;
1295 if (e
->type
!= FORMAT_HLINE
1296 && e
->type
!= FORMAT_DOUBLE_HLINE
1297 // Unfortunately tbl treats a span as needing data.
1298 // && e->type != FORMAT_SPAN
1304 for (cnt
= 0; cnt
< ncolumns
; cnt
++)
1305 tbl
->add_entry(current_row
, cnt
, input_entry
,
1306 f
->entry
[format_index
] + cnt
, current_filename
,
1308 tbl
->add_vlines(current_row
, f
->vline
[format_index
]);
1312 entry_format
*line_format
= f
->entry
[format_index
];
1314 int row_comment
= 0;
1316 if (c
== tab_char
|| c
== '\n') {
1317 int ln
= current_lineno
;
1320 if ((opt
->flags
& table::NOSPACES
))
1321 input_entry
.remove_spaces();
1322 while (col
< ncolumns
1323 && line_format
[col
].type
== FORMAT_SPAN
) {
1324 tbl
->add_entry(current_row
, col
, "", &line_format
[col
],
1325 current_filename
, ln
);
1328 if (c
== '\n' && input_entry
.length() == 2
1329 && input_entry
[0] == 'T' && input_entry
[1] == '{') {
1333 START
, MIDDLE
, GOT_T
, GOT_RIGHT_BRACE
, GOT_DOT
,
1336 while (state
!= END
) {
1354 state
= GOT_RIGHT_BRACE
;
1358 state
= c
== '\n' ? START
: MIDDLE
;
1367 state
= c
== '\n' ? START
: MIDDLE
;
1374 input_entry
+= ".l";
1376 state
= c
== '\n' ? START
: MIDDLE
;
1380 if (c
== ' ' || c
== '\n' || compatible_flag
) {
1382 input_entry
+= ".lf";
1390 interpret_lf_args(args
.contents());
1392 args
.set_length(args
.length() - 1);
1393 input_entry
+= args
;
1397 input_entry
+= ".lf";
1402 case GOT_RIGHT_BRACE
:
1403 if ((opt
->flags
& table::NOSPACES
)) {
1409 if (c
== '\n' || c
== tab_char
)
1429 error("end of data in middle of text block");
1434 if (col
>= ncolumns
) {
1435 if (!input_entry
.empty()) {
1436 if (input_entry
.length() >= 2
1437 && input_entry
[0] == '\\'
1438 && input_entry
[1] == '"')
1440 else if (!row_comment
) {
1443 input_entry
+= '\0';
1444 error("excess data entry `%1' discarded",
1445 input_entry
.contents());
1452 tbl
->add_entry(current_row
, col
, input_entry
,
1453 &line_format
[col
], current_filename
, ln
);
1468 for (; col
< ncolumns
; col
++)
1469 tbl
->add_entry(current_row
, col
, input_entry
, &line_format
[col
],
1470 current_filename
, current_lineno
- 1);
1471 tbl
->add_vlines(current_row
, f
->vline
[format_index
]);
1476 case TROFF_INPUT_LINE
:
1479 int ln
= current_lineno
;
1489 tbl
->add_text_line(current_row
, line
, current_filename
, ln
);
1490 if (line
.length() >= 4
1491 && line
[0] == '.' && line
[1] == 'T' && line
[2] == '&') {
1492 format
*newf
= process_format(in
, opt
, f
);
1498 if (line
.length() >= 3
1499 && line
[0] == '.' && line
[1] == 'l' && line
[2] == 'f') {
1501 interpret_lf_args(line
.contents() + 3);
1506 tbl
->add_single_hline(current_row
);
1509 tbl
->add_double_hline(current_row
);
1517 if (!give_up
&& current_row
== 0) {
1518 error("no real data");
1525 // Do this here rather than at the beginning in case continued formats
1528 for (i
= 0; i
< ncolumns
- 1; i
++)
1529 if (f
->separation
[i
] >= 0)
1530 tbl
->set_column_separation(i
, f
->separation
[i
]);
1531 for (i
= 0; i
< ncolumns
; i
++)
1532 if (!f
->width
[i
].empty())
1533 tbl
->set_minimum_width(i
, f
->width
[i
]);
1534 for (i
= 0; i
< ncolumns
; i
++)
1536 tbl
->set_equal_column(i
);
1537 for (i
= 0; i
< ncolumns
; i
++)
1539 tbl
->set_expand_column(i
);
1543 void process_table(table_input
&in
)
1548 if ((opt
= process_options(in
)) != 0
1549 && (form
= process_format(in
, opt
)) != 0
1550 && (tbl
= process_data(in
, form
, opt
)) != 0) {
1555 error("giving up on this table");
1556 while (in
.get() != EOF
)
1562 error("premature end of file");
1565 static void usage(FILE *stream
)
1567 fprintf(stream
, "Synopsis: %s [ -vC ] [ files... ]\n", program_name
);
1570 int main(int argc
, char **argv
)
1572 program_name
= argv
[0];
1573 static char stderr_buf
[BUFSIZ
];
1574 setbuf(stderr
, stderr_buf
);
1576 static const struct option long_options
[] = {
1577 { "help", no_argument
, 0, CHAR_MAX
+ 1 },
1578 { "version", no_argument
, 0, 'v' },
1581 while ((opt
= getopt_long(argc
, argv
, "vCT:", long_options
, NULL
)) != EOF
)
1584 compatible_flag
= 1;
1588 puts(L_P_TBL
" (" T_ROFF
") v" VERSION
);
1593 // I'm sick of getting bug reports from IRIX users
1595 case CHAR_MAX
+ 1: // --help
1606 printf(".if !\\n(.g .ab " L_P_TBL
" requires " L_TROFF
".\n"
1608 ".if !dTE .ds TE\n");
1611 do /*while (optind < argc)*/ {
1612 if ((current_filename
= argv
[optind
++]) == NULL
)
1613 current_filename
= "-";
1614 fcp
= file_case::muxer(current_filename
);
1616 assert(strcmp(current_filename
, "-"));
1617 fatal("can't open `%1': %2", current_filename
, strerror(errno
));
1621 printf(".lf 1 %s\n", current_filename
);
1622 process_input_file(fcp
);
1625 } while (optind
< argc
);
1627 if (ferror(stdout
) || fflush(stdout
) < 0)
1628 fatal("output error");