2 /* Copyright (C) 1989-2014 Free Software Foundation, Inc.
3 Written by James Clark (jjc@jclark.com)
5 This file is part of groff.
7 groff is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 groff is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
29 #include "stringclass.h"
33 // PREFIX and PREFIX_CHAR must be the same.
35 #define PREFIX_CHAR '3'
37 // LEADER and LEADER_CHAR must be the same.
39 #define LEADER_CHAR 'a'
46 struct entry_modifier {
47 inc_number point_size;
48 inc_number vertical_spacing;
51 enum { CENTER, TOP, BOTTOM } vertical_alignment;
71 struct entry_format : public entry_modifier {
74 entry_format(format_type);
76 void debug_print() const;
80 struct horizontal_span;
89 char decimal_point_char;
90 vertical_rule *vrule_list;
92 horizontal_span *span_list;
93 table_entry *entry_list;
94 table_entry **entry_list_tailp;
97 char *row_is_all_lines;
98 string *minimum_width;
99 int *column_separation;
102 int right_separation;
103 int total_separation;
105 void build_span_list();
106 void compute_expand_width();
107 void do_hspan(int r, int c);
108 void do_vspan(int r, int c);
109 void allocate(int r);
110 void compute_widths();
111 void divide_span(int, int);
112 void sum_columns(int, int, int);
113 void compute_total_separation();
114 void compute_separation_factor();
115 void compute_column_positions();
118 void add_stuff(stuff *);
121 void do_vertical_rules();
122 void build_vrule_list();
123 void add_vertical_rule(int, int, int, int);
124 void define_bottom_macro();
125 int vline_spanned(int r, int c);
126 int row_begins_section(int);
127 int row_ends_section(int);
128 void make_columns_equal();
129 void compute_vrule_top_adjust(int, int, string &);
130 void compute_vrule_bot_adjust(int, int, string &);
131 void determine_row_type();
132 int count_expand_columns();
140 DOUBLEBOX = 0x00000010,
142 NOSPACES = 0x00000040,
144 EXPERIMENTAL = 0x80000000 // undocumented; use as a hook for experiments
147 table(int nc, unsigned flags, int linesize, char decimal_point_char);
150 void add_text_line(int r, const string &, const char *, int);
151 void add_single_hline(int r);
152 void add_double_hline(int r);
153 void add_entry(int r, int c, const string &, const entry_format *,
154 const char *, int lineno);
155 void add_vlines(int r, const char *);
158 void set_minimum_width(int c, const string &w);
159 void set_column_separation(int c, int n);
160 void set_equal_column(int c);
161 void set_expand_column(int c);
162 void set_delim(char c1, char c2);
163 void print_single_hline(int r);
164 void print_double_hline(int r);
168 void set_troff_location(const char *, int);
170 extern int compatible_flag;