1 /*@ Provides a minimal troff state machine which is necessary to
2 *@ emit meta tags for the post-grohtml device driver.
4 * Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
6 * Copyright (C) 2003, 2004 Free Software Foundation, Inc.
7 * written by Gaius Mulley (gaius@glam.ac.uk)
9 * This 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 * This 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.
27 #include "troff-config.h"
37 void diff(FILE *, const char *, int_value
);
38 int differs(int_value
);
41 void set_if_unknown(int);
50 void diff(FILE *, const char *, bool_value
);
59 void diff(FILE *, const char *, units_value
);
60 int differs(units_value
);
72 void diff(FILE *, const char *, string_value
);
73 int differs(string_value
);
78 enum bool_value_state
{
84 enum int_value_state
{
92 enum units_value_state
{
100 enum string_value_state
{
108 bool_value bool_values
[LAST_BOOL
];
109 int_value int_values
[LAST_INT
];
110 units_value units_values
[LAST_UNITS
];
111 string_value string_values
[LAST_STRING
];
117 void flush(FILE *, statem
*);
118 int changed(statem
*);
119 void merge(statem
*, statem
*);
120 void add_tag(int_value_state
, int);
121 void add_tag(bool_value_state
);
122 void add_tag(units_value_state
, hunits
);
123 void add_tag(string_value_state
, string
);
125 void add_tag_if_unknown(int_value_state
, int);
127 void display_state();
128 void update(statem
*, statem
*, int_value_state
);
129 void update(statem
*, statem
*, bool_value_state
);
130 void update(statem
*, statem
*, units_value_state
);
131 void update(statem
*, statem
*, string_value_state
);
141 stack(statem
*, stack
*);
150 int has_changed(int_value_state
, statem
*);
151 int has_changed(bool_value_state
, statem
*);
152 int has_changed(units_value_state
, statem
*);
153 int has_changed(string_value_state
, statem
*);
154 void inherit(statem
*, int);
159 void push_state(statem
*);
161 void flush(FILE *, statem
*, string
);
162 int changed(statem
*);
163 void add_tag(FILE *, string
);
176 void incl(bool_value_state
);
177 void incl(int_value_state
);
178 void incl(units_value_state
);
179 void incl(string_value_state
);
180 void excl(bool_value_state
);
181 void excl(int_value_state
);
182 void excl(units_value_state
);
183 void excl(string_value_state
);
184 int is_in(bool_value_state
);
185 int is_in(int_value_state
);
186 int is_in(units_value_state
);
187 int is_in(string_value_state
);
188 void add(units_value_state
, int);
189 units
val(units_value_state
);