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/>. */
21 class reg : public object {
23 virtual const char *get_string() = 0;
24 virtual int get_value(units *);
25 virtual void increment();
26 virtual void decrement();
27 virtual void set_increment(units);
28 virtual void alter_format(char f, int w = 0);
29 virtual const char *get_format();
30 virtual void set_value(units);
33 class constant_int_reg : public reg {
36 constant_int_reg(int *);
37 const char *get_string();
40 class general_reg : public reg {
46 const char *get_string();
49 void alter_format(char f, int w = 0);
50 void set_increment(units);
51 const char *get_format();
52 void add_value(units);
54 void set_value(units) = 0;
55 int get_value(units *) = 0;
58 class variable_reg : public general_reg {
62 void set_value(units);
63 int get_value(units *);
66 extern object_dictionary number_reg_dictionary;
67 extern void set_number_reg(symbol nm, units n);
68 extern void check_output_limits(int x, int y);
69 extern void reset_output_registers();
71 reg *lookup_number_reg(symbol);
73 void inline_define_reg();