1 /* expand-common - common functionality for expand/unexpand
3 Copyright (C) 1989-2024 Free Software Foundation, Inc.
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
18 /* Column numbers are nonnegative, with the leftmost column being zero.
19 Use a signed type, as that allows for better checking. */
20 typedef intmax_t colno
;
22 /* If true, convert blanks even after nonblank characters have been
24 extern bool convert_entire_line
;
26 /* The maximum distance between tab stops. */
27 extern idx_t max_column_width
;
29 /* The desired exit status. */
30 extern int exit_status
;
32 /* Add tab stop TABVAL to the end of 'tab_list'. */
34 add_tab_stop (colno tabval
);
36 /* Add the comma or blank separated list of tab stops STOPS
37 to the list of tab stops. */
39 parse_tab_stops (char const *stops
) _GL_ATTRIBUTE_NONNULL ();
43 get_next_tab_column (const colno column
, idx_t
*tab_index
,
45 _GL_ATTRIBUTE_NONNULL ((3));
47 /* Called after all command-line options have been parsed,
48 sets the final tab-stops values */
50 finalize_tab_stops (void);
55 /* Sets new file-list */
57 set_file_list (char **file_list
);
59 /* Close the old stream pointer FP if it is non-null,
60 and return a new one opened to read the next input file.
61 Open a filename of '-' as the standard input.
62 Return nullptr if there are no more input files. */
68 cleanup_file_list_stdin (void);
72 emit_tab_list_info (void);