2 /* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, 2005,
4 Free Software Foundation, Inc.
5 Written by James Clark (jjc@jclark.com)
7 This file is part of groff.
9 groff is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 2, or (at your option) any later
14 groff is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 You should have received a copy of the GNU General Public License along
20 with groff; see the file COPYING. If not, write to the Free Software
21 Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
23 #include "file_case.h"
27 #define MAX_POINT_SIZE 99
28 #define MAX_VERTICAL_SPACING 72
30 extern "C" const char *Version_string
;
32 int compatible_flag
= 0;
37 REREAD_T
, REREAD_TE
, REREAD_E
,
38 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
);
352 char decimal_point_char
;
358 : flags(0), linesize(0), tab_char('\t'), decimal_point_char('.')
360 delim
[0] = delim
[1] = '\0';
363 // Return non-zero if p and q are the same ignoring case.
365 int strieq(const char *p
, const char *q
)
367 for (; cmlower(*p
) == cmlower(*q
); p
++, q
++)
373 // return 0 if we should give up in this table
375 options
*process_options(table_input
&in
)
377 options
*opt
= new options
;
383 int i
= line
.length();
390 int i
= line
.length();
399 else if (c
== ';' && level
== 0) {
409 while (!csalpha(*p
) && *p
!= '\0')
417 if (*q
!= '(' && *q
!= '\0')
424 while (*q
!= ')' && *q
!= '\0')
427 error("missing `)'");
433 error("argument without option");
435 else if (strieq(p
, "tab")) {
437 error("`tab' option requires argument in parentheses");
439 if (arg
[0] == '\0' || arg
[1] != '\0')
440 error("argument to `tab' option must be a single character");
442 opt
->tab_char
= arg
[0];
445 else if (strieq(p
, "linesize")) {
447 error("`linesize' option requires argument in parentheses");
449 if (sscanf(arg
, "%d", &opt
->linesize
) != 1)
450 error("bad linesize `%s'", arg
);
451 else if (opt
->linesize
<= 0) {
452 error("linesize must be positive");
457 else if (strieq(p
, "delim")) {
459 error("`delim' option requires argument in parentheses");
460 else if (arg
[0] == '\0' || arg
[1] == '\0' || arg
[2] != '\0')
461 error("argument to `delim' option must be two characters");
463 opt
->delim
[0] = arg
[0];
464 opt
->delim
[1] = arg
[1];
467 else if (strieq(p
, "center") || strieq(p
, "centre")) {
469 error("`center' option does not take an argument");
470 opt
->flags
|= table::CENTER
;
472 else if (strieq(p
, "expand")) {
474 error("`expand' option does not take an argument");
475 opt
->flags
|= table::EXPAND
;
477 else if (strieq(p
, "box") || strieq(p
, "frame")) {
479 error("`box' option does not take an argument");
480 opt
->flags
|= table::BOX
;
482 else if (strieq(p
, "doublebox") || strieq(p
, "doubleframe")) {
484 error("`doublebox' option does not take an argument");
485 opt
->flags
|= table::DOUBLEBOX
;
487 else if (strieq(p
, "allbox")) {
489 error("`allbox' option does not take an argument");
490 opt
->flags
|= table::ALLBOX
;
492 else if (strieq(p
, "nokeep")) {
494 error("`nokeep' option does not take an argument");
495 opt
->flags
|= table::NOKEEP
;
497 else if (strieq(p
, "nospaces")) {
499 error("`nospaces' option does not take an argument");
500 opt
->flags
|= table::NOSPACES
;
502 else if (strieq(p
, "decimalpoint")) {
504 error("`decimalpoint' option requires argument in parentheses");
506 if (arg
[0] == '\0' || arg
[1] != '\0')
507 error("argument to `decimalpoint' option must be a single character");
509 opt
->decimal_point_char
= arg
[0];
512 else if (strieq(p
, "experimental")) {
513 opt
->flags
|= table::EXPERIMENTAL
;
516 error("unrecognised global option `%1'", p
);
525 entry_modifier::entry_modifier()
526 : vertical_alignment(CENTER
), zero_width(0), stagger(0)
528 vertical_spacing
.inc
= vertical_spacing
.val
= 0;
529 point_size
.inc
= point_size
.val
= 0;
532 entry_modifier::~entry_modifier()
536 entry_format::entry_format() : type(FORMAT_LEFT
)
540 entry_format::entry_format(format_type t
) : type(t
)
544 void entry_format::debug_print() const
559 case FORMAT_ALPHABETIC
:
571 case FORMAT_DOUBLE_HLINE
:
578 if (point_size
.val
!= 0) {
580 if (point_size
.inc
> 0)
582 else if (point_size
.inc
< 0)
584 fprintf(stderr
, "%d ", point_size
.val
);
586 if (vertical_spacing
.val
!= 0) {
588 if (vertical_spacing
.inc
> 0)
590 else if (vertical_spacing
.inc
< 0)
592 fprintf(stderr
, "%d ", vertical_spacing
.val
);
596 put_string(font
, stderr
);
599 if (!macro
.empty()) {
601 put_string(macro
, stderr
);
604 switch (vertical_alignment
) {
605 case entry_modifier::CENTER
:
607 case entry_modifier::TOP
:
610 case entry_modifier::BOTTOM
:
627 entry_format
**entry
;
630 format(int nr
, int nc
);
632 void add_rows(int n
);
635 format::format(int nr
, int nc
) : nrows(nr
), ncolumns(nc
)
638 separation
= ncolumns
> 1 ? new int[ncolumns
- 1] : 0;
639 for (i
= 0; i
< ncolumns
-1; i
++)
641 width
= new string
[ncolumns
];
642 equal
= new char[ncolumns
];
643 expand
= new char[ncolumns
];
644 for (i
= 0; i
< ncolumns
; i
++) {
648 entry
= new entry_format
*[nrows
];
649 for (i
= 0; i
< nrows
; i
++)
650 entry
[i
] = new entry_format
[ncolumns
];
651 vline
= new char*[nrows
];
652 for (i
= 0; i
< nrows
; i
++) {
653 vline
[i
] = new char[ncolumns
+1];
654 for (int j
= 0; j
< ncolumns
+1; j
++)
659 void format::add_rows(int n
)
662 char **old_vline
= vline
;
663 vline
= new char*[nrows
+ n
];
664 for (i
= 0; i
< nrows
; i
++)
665 vline
[i
] = old_vline
[i
];
667 for (i
= 0; i
< n
; i
++) {
668 vline
[nrows
+ i
] = new char[ncolumns
+ 1];
669 for (int j
= 0; j
< ncolumns
+ 1; j
++)
670 vline
[nrows
+ i
][j
] = 0;
672 entry_format
**old_entry
= entry
;
673 entry
= new entry_format
*[nrows
+ n
];
674 for (i
= 0; i
< nrows
; i
++)
675 entry
[i
] = old_entry
[i
];
677 for (i
= 0; i
< n
; i
++)
678 entry
[nrows
+ i
] = new entry_format
[ncolumns
];
685 ad_delete(ncolumns
) width
;
688 for (int i
= 0; i
< nrows
; i
++) {
690 ad_delete(ncolumns
) entry
[i
];
696 struct input_entry_format
: public entry_format
{
697 input_entry_format
*next
;
705 input_entry_format(format_type
, input_entry_format
* = 0);
706 ~input_entry_format();
710 input_entry_format::input_entry_format(format_type t
, input_entry_format
*p
)
711 : entry_format(t
), next(p
)
721 input_entry_format::~input_entry_format()
725 void free_input_entry_format_list(input_entry_format
*list
)
728 input_entry_format
*tem
= list
;
734 void input_entry_format::debug_print()
737 for (i
= 0; i
< pre_vline
; i
++)
739 entry_format::debug_print();
740 if (!width
.empty()) {
743 put_string(width
, stderr
);
751 fprintf(stderr
, "%d", separation
);
752 for (i
= 0; i
< vline
; i
++)
758 // Return zero if we should give up on this table.
759 // If this is a continuation format line, current_format will be the current
762 format
*process_format(table_input
&in
, options
*opt
,
763 format
*current_format
= 0)
765 input_entry_format
*list
= 0;
772 format_type t
= FORMAT_LEFT
;
775 error("end of input while processing format");
776 free_input_entry_format_list(list
);
788 t
= FORMAT_ALPHABETIC
;
815 case '-': // tbl also accepts this
821 t
= FORMAT_DOUBLE_HLINE
;
834 if (c
== opt
->tab_char
)
836 error("unrecognised format `%1'", char(c
));
837 free_input_entry_format_list(list
);
848 list
= new input_entry_format(t
, list
);
850 list
->pre_vline
= pre_vline
;
867 w
= w
*10 + (c
- '0');
869 } while (c
!= EOF
&& csdigit(c
));
870 list
->separation
= w
;
881 list
->vertical_alignment
= entry_modifier::BOTTOM
;
887 // `e' and `x' are mutually exclusive
894 } while (c
== ' ' || c
== '\t');
896 error("missing font name");
902 if (c
== EOF
|| c
== ' ' || c
== '\t') {
903 error("missing `)'");
910 list
->font
+= char(c
);
918 && c
!= EOF
&& c
!= ' ' && c
!= '\t' && c
!= '.' && c
!= '\n') {
919 list
->font
+= char(c
);
933 } while (c
== ' ' || c
== '\t');
935 error("missing macro name");
941 if (c
== EOF
|| c
== ' ' || c
== '\t') {
942 error("missing `)'");
949 list
->macro
+= char(c
);
957 && c
!= EOF
&& c
!= ' ' && c
!= '\t' && c
!= '.' && c
!= '\n') {
958 list
->macro
+= char(c
);
966 list
->point_size
.val
= 0;
967 list
->point_size
.inc
= 0;
968 if (c
== '+' || c
== '-') {
969 list
->point_size
.inc
= (c
== '+' ? 1 : -1);
972 if (c
== EOF
|| !csdigit(c
)) {
973 error("`p' modifier must be followed by number");
974 list
->point_size
.inc
= 0;
978 list
->point_size
.val
*= 10;
979 list
->point_size
.val
+= c
- '0';
981 } while (c
!= EOF
&& csdigit(c
));
983 if (list
->point_size
.val
> MAX_POINT_SIZE
984 || list
->point_size
.val
< -MAX_POINT_SIZE
) {
985 error("unreasonable point size");
986 list
->point_size
.val
= 0;
987 list
->point_size
.inc
= 0;
993 list
->vertical_alignment
= entry_modifier::TOP
;
1003 list
->vertical_spacing
.val
= 0;
1004 list
->vertical_spacing
.inc
= 0;
1005 if (c
== '+' || c
== '-') {
1006 list
->vertical_spacing
.inc
= (c
== '+' ? 1 : -1);
1009 if (c
== EOF
|| !csdigit(c
)) {
1010 error("`v' modifier must be followed by number");
1011 list
->vertical_spacing
.inc
= 0;
1015 list
->vertical_spacing
.val
*= 10;
1016 list
->vertical_spacing
.val
+= c
- '0';
1018 } while (c
!= EOF
&& csdigit(c
));
1020 if (list
->vertical_spacing
.val
> MAX_VERTICAL_SPACING
1021 || list
->vertical_spacing
.val
< -MAX_VERTICAL_SPACING
) {
1022 error("unreasonable vertical spacing");
1023 list
->vertical_spacing
.val
= 0;
1024 list
->vertical_spacing
.inc
= 0;
1030 while (c
== ' ' || c
== '\t')
1036 if (c
== EOF
|| c
== '\n') {
1037 error("missing `)'");
1038 free_input_entry_format_list(list
);
1047 if (c
== '+' || c
== '-') {
1048 list
->width
= char(c
);
1053 if (c
== EOF
|| !csdigit(c
))
1054 error("bad argument for `w' modifier");
1057 list
->width
+= char(c
);
1059 } while (c
!= EOF
&& csdigit(c
));
1062 // `w' and `x' are mutually exclusive
1069 // `x' and `e' are mutually exclusive
1071 // `x' and `w' are mutually exclusive
1077 list
->zero_width
= 1;
1088 if (c
== opt
->tab_char
)
1095 if (list
->vline
> 2) {
1097 error("more than 2 vertical bars between key letters");
1099 if (c
== '\n' || c
== ',') {
1101 list
->last_column
= 1;
1107 } while (c
== ' ' || c
== '\t');
1109 error("`.' not last character on line");
1110 free_input_entry_format_list(list
);
1116 free_input_entry_format_list(list
);
1119 list
->last_column
= 1;
1120 // now reverse the list so that the first row is at the beginning
1121 input_entry_format
*rev
= 0;
1123 input_entry_format
*tem
= list
->next
;
1129 input_entry_format
*tem
;
1132 for (tem
= list
; tem
; tem
= tem
->next
)
1136 // compute number of columns and rows
1140 for (tem
= list
; tem
; tem
= tem
->next
) {
1141 if (tem
->last_column
) {
1142 if (col
>= ncolumns
)
1152 if (current_format
) {
1153 if (ncolumns
> current_format
->ncolumns
) {
1154 error("cannot increase the number of columns in a continued format");
1155 free_input_entry_format_list(list
);
1163 f
= new format(nrows
, ncolumns
);
1167 for (tem
= list
; tem
; tem
= tem
->next
) {
1168 f
->entry
[row
][col
] = *tem
;
1169 if (col
< ncolumns
- 1) {
1170 // use the greatest separation
1171 if (tem
->separation
> f
->separation
[col
]) {
1173 error("cannot change column separation in continued format");
1175 f
->separation
[col
] = tem
->separation
;
1178 else if (tem
->separation
>= 0)
1179 error("column separation specified for last column");
1180 if (tem
->equal
&& !f
->equal
[col
]) {
1182 error("cannot change which columns are equal in continued format");
1186 if (tem
->expand
&& !f
->expand
[col
]) {
1188 error("cannot change which columns are expanded in continued format");
1194 if (!tem
->width
.empty()) {
1195 // use the last width
1196 if (!f
->width
[col
].empty() && f
->width
[col
] != tem
->width
)
1197 error("multiple widths for column %1", col
+ 1);
1198 f
->width
[col
] = tem
->width
;
1200 if (tem
->pre_vline
) {
1202 f
->vline
[row
][col
] = tem
->pre_vline
;
1204 f
->vline
[row
][col
+ 1] = tem
->vline
;
1205 if (tem
->last_column
) {
1212 free_input_entry_format_list(list
);
1213 for (col
= 0; col
< ncolumns
; col
++) {
1214 entry_format
*e
= f
->entry
[f
->nrows
- 1] + col
;
1215 if (e
->type
!= FORMAT_HLINE
1216 && e
->type
!= FORMAT_DOUBLE_HLINE
1217 && e
->type
!= FORMAT_SPAN
)
1220 if (col
>= ncolumns
) {
1221 error("last row of format is all lines");
1225 if (have_expand
&& (opt
->flags
& table::EXPAND
)) {
1226 error("ignoring global `expand' option because of `x' specifiers");
1227 opt
->flags
&= ~table::EXPAND
;
1232 table
*process_data(table_input
&in
, format
*f
, options
*opt
)
1234 char tab_char
= opt
->tab_char
;
1235 int ncolumns
= f
->ncolumns
;
1236 int current_row
= 0;
1237 int format_index
= 0;
1239 enum { DATA_INPUT_LINE
, TROFF_INPUT_LINE
, SINGLE_HLINE
, DOUBLE_HLINE
} type
;
1240 table
*tbl
= new table(ncolumns
, opt
->flags
, opt
->linesize
,
1241 opt
->decimal_point_char
);
1242 if (opt
->delim
[0] != '\0')
1243 tbl
->set_delim(opt
->delim
[0], opt
->delim
[1]);
1245 // first determine what type of line this is
1251 if (d
!= EOF
&& csdigit(d
)) {
1253 type
= DATA_INPUT_LINE
;
1257 type
= TROFF_INPUT_LINE
;
1260 else if (c
== '_' || c
== '=') {
1264 type
= SINGLE_HLINE
;
1266 type
= DOUBLE_HLINE
;
1270 type
= DATA_INPUT_LINE
;
1274 type
= DATA_INPUT_LINE
;
1277 case DATA_INPUT_LINE
:
1280 if (format_index
>= f
->nrows
)
1281 format_index
= f
->nrows
- 1;
1282 // A format row that is all lines doesn't use up a data line.
1283 while (format_index
< f
->nrows
- 1) {
1285 for (cnt
= 0; cnt
< ncolumns
; cnt
++) {
1286 entry_format
*e
= f
->entry
[format_index
] + cnt
;
1287 if (e
->type
!= FORMAT_HLINE
1288 && e
->type
!= FORMAT_DOUBLE_HLINE
1289 // Unfortunately tbl treats a span as needing data.
1290 // && e->type != FORMAT_SPAN
1296 for (cnt
= 0; cnt
< ncolumns
; cnt
++)
1297 tbl
->add_entry(current_row
, cnt
, input_entry
,
1298 f
->entry
[format_index
] + cnt
, current_filename
,
1300 tbl
->add_vlines(current_row
, f
->vline
[format_index
]);
1304 entry_format
*line_format
= f
->entry
[format_index
];
1306 int row_comment
= 0;
1308 if (c
== tab_char
|| c
== '\n') {
1309 int ln
= current_lineno
;
1312 if ((opt
->flags
& table::NOSPACES
))
1313 input_entry
.remove_spaces();
1314 while (col
< ncolumns
1315 && line_format
[col
].type
== FORMAT_SPAN
) {
1316 tbl
->add_entry(current_row
, col
, "", &line_format
[col
],
1317 current_filename
, ln
);
1320 if (c
== '\n' && input_entry
.length() == 2
1321 && input_entry
[0] == 'T' && input_entry
[1] == '{') {
1325 START
, MIDDLE
, GOT_T
, GOT_RIGHT_BRACE
, GOT_DOT
,
1328 while (state
!= END
) {
1346 state
= GOT_RIGHT_BRACE
;
1350 state
= c
== '\n' ? START
: MIDDLE
;
1359 state
= c
== '\n' ? START
: MIDDLE
;
1366 input_entry
+= ".l";
1368 state
= c
== '\n' ? START
: MIDDLE
;
1372 if (c
== ' ' || c
== '\n' || compatible_flag
) {
1374 input_entry
+= ".lf";
1382 interpret_lf_args(args
.contents());
1384 args
.set_length(args
.length() - 1);
1385 input_entry
+= args
;
1389 input_entry
+= ".lf";
1394 case GOT_RIGHT_BRACE
:
1395 if ((opt
->flags
& table::NOSPACES
)) {
1401 if (c
== '\n' || c
== tab_char
)
1421 error("end of data in middle of text block");
1426 if (col
>= ncolumns
) {
1427 if (!input_entry
.empty()) {
1428 if (input_entry
.length() >= 2
1429 && input_entry
[0] == '\\'
1430 && input_entry
[1] == '"')
1432 else if (!row_comment
) {
1435 input_entry
+= '\0';
1436 error("excess data entry `%1' discarded",
1437 input_entry
.contents());
1444 tbl
->add_entry(current_row
, col
, input_entry
,
1445 &line_format
[col
], current_filename
, ln
);
1460 for (; col
< ncolumns
; col
++)
1461 tbl
->add_entry(current_row
, col
, input_entry
, &line_format
[col
],
1462 current_filename
, current_lineno
- 1);
1463 tbl
->add_vlines(current_row
, f
->vline
[format_index
]);
1468 case TROFF_INPUT_LINE
:
1471 int ln
= current_lineno
;
1481 tbl
->add_text_line(current_row
, line
, current_filename
, ln
);
1482 if (line
.length() >= 4
1483 && line
[0] == '.' && line
[1] == 'T' && line
[2] == '&') {
1484 format
*newf
= process_format(in
, opt
, f
);
1490 if (line
.length() >= 3
1491 && line
[0] == '.' && line
[1] == 'l' && line
[2] == 'f') {
1493 interpret_lf_args(line
.contents() + 3);
1498 tbl
->add_single_hline(current_row
);
1501 tbl
->add_double_hline(current_row
);
1509 if (!give_up
&& current_row
== 0) {
1510 error("no real data");
1517 // Do this here rather than at the beginning in case continued formats
1520 for (i
= 0; i
< ncolumns
- 1; i
++)
1521 if (f
->separation
[i
] >= 0)
1522 tbl
->set_column_separation(i
, f
->separation
[i
]);
1523 for (i
= 0; i
< ncolumns
; i
++)
1524 if (!f
->width
[i
].empty())
1525 tbl
->set_minimum_width(i
, f
->width
[i
]);
1526 for (i
= 0; i
< ncolumns
; i
++)
1528 tbl
->set_equal_column(i
);
1529 for (i
= 0; i
< ncolumns
; i
++)
1531 tbl
->set_expand_column(i
);
1535 void process_table(table_input
&in
)
1540 if ((opt
= process_options(in
)) != 0
1541 && (form
= process_format(in
, opt
)) != 0
1542 && (tbl
= process_data(in
, form
, opt
)) != 0) {
1547 error("giving up on this table");
1548 while (in
.get() != EOF
)
1554 error("premature end of file");
1557 static void usage(FILE *stream
)
1559 fprintf(stream
, "usage: %s [ -vC ] [ files... ]\n", program_name
);
1562 int main(int argc
, char **argv
)
1564 program_name
= argv
[0];
1565 static char stderr_buf
[BUFSIZ
];
1566 setbuf(stderr
, stderr_buf
);
1568 static const struct option long_options
[] = {
1569 { "help", no_argument
, 0, CHAR_MAX
+ 1 },
1570 { "version", no_argument
, 0, 'v' },
1573 while ((opt
= getopt_long(argc
, argv
, "vCT:", long_options
, NULL
)) != EOF
)
1576 compatible_flag
= 1;
1580 printf("GNU tbl (groff) version %s\n", Version_string
);
1585 // I'm sick of getting bug reports from IRIX users
1587 case CHAR_MAX
+ 1: // --help
1598 printf(".if !\\n(.g .ab GNU tbl requires GNU troff.\n"
1600 ".if !dTE .ds TE\n");
1603 do /*while (optind < argc)*/ {
1604 if ((current_filename
= argv
[optind
++]) == NULL
)
1605 current_filename
= "-";
1606 fcp
= file_case::muxer(current_filename
);
1608 assert(strcmp(current_filename
, "-"));
1609 fatal("can't open `%1': %2", current_filename
, strerror(errno
));
1613 printf(".lf 1 %s\n", current_filename
);
1614 process_input_file(fcp
);
1617 } while (optind
< argc
);
1619 if (ferror(stdout
) || fflush(stdout
) < 0)
1620 fatal("output error");