groff: update vendor branch to v1.20.1
[dragonfly.git] / contrib / groff / src / roff / troff / reg.h
CommitLineData
92d0a6a6 1// -*- C++ -*-
4d3e9548 2/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2003, 2009
92d0a6a6
JR
3 Free Software Foundation, Inc.
4 Written by James Clark (jjc@jclark.com)
5
6This file is part of groff.
7
8groff is free software; you can redistribute it and/or modify it under
9the terms of the GNU General Public License as published by the Free
4d3e9548
JL
10Software Foundation, either version 3 of the License, or
11(at your option) any later version.
92d0a6a6
JR
12
13groff is distributed in the hope that it will be useful, but WITHOUT ANY
14WARRANTY; without even the implied warranty of MERCHANTABILITY or
15FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16for more details.
17
4d3e9548
JL
18You should have received a copy of the GNU General Public License
19along with this program. If not, see <http://www.gnu.org/licenses/>. */
92d0a6a6
JR
20
21
22class reg : public object {
23public:
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);
32};
33
34class constant_int_reg : public reg {
35 int *p;
36public:
37 constant_int_reg(int *);
38 const char *get_string();
39};
40
41class general_reg : public reg {
42 char format;
43 int width;
44 int inc;
45public:
46 general_reg();
47 const char *get_string();
48 void increment();
49 void decrement();
50 void alter_format(char f, int w = 0);
51 void set_increment(units);
52 const char *get_format();
53 void add_value(units);
54
55 void set_value(units) = 0;
56 int get_value(units *) = 0;
57};
58
59class variable_reg : public general_reg {
60 units *ptr;
61public:
62 variable_reg(int *);
63 void set_value(units);
64 int get_value(units *);
65};
66
67extern object_dictionary number_reg_dictionary;
68extern void set_number_reg(symbol nm, units n);
69extern void check_output_limits(int x, int y);
70extern void reset_output_registers();
71
72reg *lookup_number_reg(symbol);
73#if 0
74void inline_define_reg();
75#endif