1/* $NetBSD: reg.h,v 1.1.1.1 2016/01/13 18:41:48 christos Exp $ */ 2 3// -*- C++ -*- 4/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2003 5 Free Software Foundation, Inc. 6 Written by James Clark (jjc@jclark.com) 7 8This file is part of groff. 9 10groff is free software; you can redistribute it and/or modify it under 11the terms of the GNU General Public License as published by the Free 12Software Foundation; either version 2, or (at your option) any later 13version. 14 15groff is distributed in the hope that it will be useful, but WITHOUT ANY 16WARRANTY; without even the implied warranty of MERCHANTABILITY or 17FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 18for more details. 19 20You should have received a copy of the GNU General Public License along 21with groff; see the file COPYING. If not, write to the Free Software 22Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */ 23 24 25class reg : public object { 26public: 27 virtual const char *get_string() = 0; 28 virtual int get_value(units *); 29 virtual void increment(); 30 virtual void decrement(); 31 virtual void set_increment(units); 32 virtual void alter_format(char f, int w = 0); 33 virtual const char *get_format(); 34 virtual void set_value(units); 35}; 36 37class constant_int_reg : public reg { 38 int *p; 39public: 40 constant_int_reg(int *); 41 const char *get_string(); 42}; 43 44class general_reg : public reg { 45 char format; 46 int width; 47 int inc; 48public: 49 general_reg(); 50 const char *get_string(); 51 void increment(); 52 void decrement(); 53 void alter_format(char f, int w = 0); 54 void set_increment(units); 55 const char *get_format(); 56 void add_value(units); 57 58 void set_value(units) = 0; 59 int get_value(units *) = 0; 60}; 61 62class variable_reg : public general_reg { 63 units *ptr; 64public: 65 variable_reg(int *); 66 void set_value(units); 67 int get_value(units *); 68}; 69 70extern object_dictionary number_reg_dictionary; 71extern void set_number_reg(symbol nm, units n); 72extern void check_output_limits(int x, int y); 73extern void reset_output_registers(); 74 75reg *lookup_number_reg(symbol); 76#if 0 77void inline_define_reg(); 78#endif 79