2 /* Copyright (C) 2003-2018 Free Software Foundation, Inc.
6 * written by Gaius Mulley (gaius@glam.ac.uk)
8 * provides a minimal troff state machine which is necessary to
9 * emit meta tags for the post-grohtml device driver.
13 This file is part of groff.
15 groff is free software; you can redistribute it and/or modify it under
16 the terms of the GNU General Public License as published by the Free
17 Software Foundation, either version 3 of the License, or
18 (at your option) any later version.
20 groff is distributed in the hope that it will be useful, but WITHOUT ANY
21 WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25 You should have received a copy of the GNU General Public License
26 along with this program. If not, see <http://www.gnu.org/licenses/>. */
33 void diff(FILE *, const char *, int_value);
34 int differs(int_value);
37 void set_if_unknown(int);
40 struct bool_value : public int_value {
43 void diff(FILE *, const char *, bool_value);
46 struct units_value : public int_value {
49 void diff(FILE *, const char *, units_value);
50 int differs(units_value);
59 void diff(FILE *, const char *, string_value);
60 int differs(string_value);
65 enum bool_value_state {
70 enum int_value_state {
77 enum units_value_state {
84 enum string_value_state {
91 bool_value bool_values[LAST_BOOL];
92 int_value int_values[LAST_INT];
93 units_value units_values[LAST_UNITS];
94 string_value string_values[LAST_STRING];
98 void flush(FILE *, statem *);
99 int changed(statem *);
100 void merge(statem *, statem *);
101 void add_tag(int_value_state, int);
102 void add_tag(bool_value_state);
103 void add_tag(units_value_state, hunits);
104 void add_tag(string_value_state, string);
106 void add_tag_if_unknown(int_value_state, int);
108 void display_state();
109 void update(statem *, statem *, int_value_state);
110 void update(statem *, statem *, bool_value_state);
111 void update(statem *, statem *, units_value_state);
112 void update(statem *, statem *, string_value_state);
119 stack(statem *, stack *);
126 int has_changed(int_value_state, statem *);
127 int has_changed(bool_value_state, statem *);
128 int has_changed(units_value_state, statem *);
129 int has_changed(string_value_state, statem *);
130 void inherit(statem *, int);
134 void push_state(statem *);
136 void flush(FILE *, statem *, string);
137 int changed(statem *);
138 void add_tag(FILE *, string);
149 void incl(bool_value_state);
150 void incl(int_value_state);
151 void incl(units_value_state);
152 void incl(string_value_state);
153 void excl(bool_value_state);
154 void excl(int_value_state);
155 void excl(units_value_state);
156 void excl(string_value_state);
157 int is_in(bool_value_state);
158 int is_in(int_value_state);
159 int is_in(units_value_state);
160 int is_in(string_value_state);
161 void add(units_value_state, int);
162 units val(units_value_state);