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 6 This file is part of groff. 7 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 2, or (at your option) any later 11 version. 12 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 16 for more details. 17 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. */ 21 22 23 class reg : public object { 24 public: 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 35 class constant_int_reg : public reg { 36 int *p; 37 public: 38 constant_int_reg(int *); 39 const char *get_string(); 40 }; 41 42 class general_reg : public reg { 43 char format; 44 int width; 45 int inc; 46 public: 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 60 class variable_reg : public general_reg { 61 units *ptr; 62 public: 63 variable_reg(int *); 64 void set_value(units); 65 int get_value(units *); 66 }; 67 68 extern object_dictionary number_reg_dictionary; 69 extern void set_number_reg(symbol nm, units n); 70 extern void check_output_limits(int x, int y); 71 extern void reset_output_registers(); 72 73 reg *lookup_number_reg(symbol); 74 #if 0 75 void inline_define_reg(); 76 #endif 77