Sync-to-go: update copyright for 2015
[s-roff.git] / src / troff / reg.h
blobd511b9da156c52e584b6c9d2181cef737342ca62
1 /*@
2 * Copyright (c) 2014 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
4 * Copyright (C) 1989 - 1992, 2000, 2001, 2003
5 * Free Software Foundation, Inc.
6 * Written by James Clark (jjc@jclark.com)
8 * This 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 2, or (at your option) any later
11 * version.
13 * This 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
16 * for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with groff; see the file COPYING. If not, write to the Free Software
20 * Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef _REG_H
23 #define _REG_H
25 #include "config.h"
26 #include "troff-config.h"
28 class reg
29 : public object
31 public:
32 virtual const char *get_string() = 0;
33 virtual int get_value(units *);
34 virtual void increment();
35 virtual void decrement();
36 virtual void set_increment(units);
37 virtual void alter_format(char f, int w = 0);
38 virtual const char *get_format();
39 virtual void set_value(units);
42 class constant_int_reg
43 : public reg
45 int *p;
47 public:
48 constant_int_reg(int *);
49 const char *get_string();
52 class general_reg
53 : public reg
55 char format;
56 int width;
57 int inc;
59 public:
60 general_reg();
61 const char *get_string();
62 void increment();
63 void decrement();
64 void alter_format(char f, int w = 0);
65 void set_increment(units);
66 const char *get_format();
67 void add_value(units);
69 void set_value(units) = 0;
70 int get_value(units *) = 0;
73 class variable_reg
74 : public general_reg
76 units *ptr;
78 public:
79 variable_reg(int *);
80 void set_value(units);
81 int get_value(units *);
84 extern object_dictionary number_reg_dictionary;
85 extern void set_number_reg(symbol nm, units n);
86 extern void check_output_limits(int x, int y);
87 extern void reset_output_registers();
89 reg *lookup_number_reg(symbol);
90 #if 0
91 void inline_define_reg();
92 #endif
94 #endif // _REG_H
95 // s-it2-mode