1// -*- C++ -*-
2/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2003
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
10Software Foundation; either version 2, or (at your option) any later
11version.
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
18You should have received a copy of the GNU General Public License along
19with groff; see the file COPYING.  If not, write to the Free Software
20Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
21
22
23class reg : public object {
24public:
25  virtual const char *get_string() = 0;
26  virtual int get_value(units *);
27  virtual void increment();
28  virtual void decrement();
29  virtual void set_increment(units);
30  virtual void alter_format(char f, int w = 0);
31  virtual const char *get_format();
32  virtual void set_value(units);
33};
34
35class constant_int_reg : public reg {
36  int *p;
37public:
38  constant_int_reg(int *);
39  const char *get_string();
40};
41
42class general_reg : public reg {
43  char format;
44  int width;
45  int inc;
46public:
47  general_reg();
48  const char *get_string();
49  void increment();
50  void decrement();
51  void alter_format(char f, int w = 0);
52  void set_increment(units);
53  const char *get_format();
54  void add_value(units);
55
56  void set_value(units) = 0;
57  int get_value(units *) = 0;
58};
59
60class variable_reg : public general_reg {
61  units *ptr;
62public:
63  variable_reg(int *);
64  void set_value(units);
65  int get_value(units *);
66};
67
68extern object_dictionary number_reg_dictionary;
69extern void set_number_reg(symbol nm, units n);
70extern void check_output_limits(int x, int y);
71extern void reset_output_registers();
72
73reg *lookup_number_reg(symbol);
74#if 0
75void inline_define_reg();
76#endif
77