2 /* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2003, 2009
3 Free Software Foundation, Inc.
4 Written by James Clark (jjc@jclark.com)
6 This file is part of groff.
8 groff is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 groff is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 class reg : public object {
24 virtual const char *get_string() = 0;
25 virtual int get_value(units *);
26 virtual void increment();
27 virtual void decrement();
28 virtual void set_increment(units);
29 virtual void alter_format(char f, int w = 0);
30 virtual const char *get_format();
31 virtual void set_value(units);
34 class constant_int_reg : public reg {
37 constant_int_reg(int *);
38 const char *get_string();
41 class general_reg : public reg {
47 const char *get_string();
50 void alter_format(char f, int w = 0);
51 void set_increment(units);
52 const char *get_format();
53 void add_value(units);
55 void set_value(units) = 0;
56 int get_value(units *) = 0;
59 class variable_reg : public general_reg {
63 void set_value(units);
64 int get_value(units *);
67 extern object_dictionary number_reg_dictionary;
68 extern void set_number_reg(symbol nm, units n);
69 extern void check_output_limits(int x, int y);
70 extern void reset_output_registers();
72 reg *lookup_number_reg(symbol);
74 void inline_define_reg();