2 /* Copyright (C) 2003, 2004 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 2, or (at your option) any later
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 along
26 with groff; see the file COPYING. If not, write to the Free Software
27 Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
34 void diff(FILE *, const char *, int_value);
35 int differs(int_value);
38 void set_if_unknown(int);
41 struct bool_value : public int_value {
44 void diff(FILE *, const char *, bool_value);
47 struct units_value : public int_value {
50 void diff(FILE *, const char *, units_value);
51 int differs(units_value);
60 void diff(FILE *, const char *, string_value);
61 int differs(string_value);
66 enum bool_value_state {
71 enum int_value_state {
78 enum units_value_state {
85 enum string_value_state {
92 bool_value bool_values[LAST_BOOL];
93 int_value int_values[LAST_INT];
94 units_value units_values[LAST_UNITS];
95 string_value string_values[LAST_STRING];
99 void flush(FILE *, statem *);
100 int changed(statem *);
101 void merge(statem *, statem *);
102 void add_tag(int_value_state, int);
103 void add_tag(bool_value_state);
104 void add_tag(units_value_state, hunits);
105 void add_tag(string_value_state, string);
107 void add_tag_if_unknown(int_value_state, int);
109 void display_state();
110 void update(statem *, statem *, int_value_state);
111 void update(statem *, statem *, bool_value_state);
112 void update(statem *, statem *, units_value_state);
113 void update(statem *, statem *, string_value_state);
120 stack(statem *, stack *);
127 int has_changed(int_value_state, statem *);
128 int has_changed(bool_value_state, statem *);
129 int has_changed(units_value_state, statem *);
130 int has_changed(string_value_state, statem *);
131 void inherit(statem *, int);
135 void push_state(statem *);
137 void flush(FILE *, statem *, string);
138 int changed(statem *);
139 void add_tag(FILE *, string);
150 void incl(bool_value_state);
151 void incl(int_value_state);
152 void incl(units_value_state);
153 void incl(string_value_state);
154 void excl(bool_value_state);
155 void excl(int_value_state);
156 void excl(units_value_state);
157 void excl(string_value_state);
158 int is_in(bool_value_state);
159 int is_in(int_value_state);
160 int is_in(units_value_state);
161 int is_in(string_value_state);
162 void add(units_value_state, int);
163 units val(units_value_state);