reg.h revision 75584
175584Sru// -*- C++ -*- 275584Sru/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001 375584Sru Free Software Foundation, Inc. 475584Sru Written by James Clark (jjc@jclark.com) 575584Sru 675584SruThis file is part of groff. 775584Sru 875584Srugroff is free software; you can redistribute it and/or modify it under 975584Sruthe terms of the GNU General Public License as published by the Free 1075584SruSoftware Foundation; either version 2, or (at your option) any later 1175584Sruversion. 1275584Sru 1375584Srugroff is distributed in the hope that it will be useful, but WITHOUT ANY 1475584SruWARRANTY; without even the implied warranty of MERCHANTABILITY or 1575584SruFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1675584Srufor more details. 1775584Sru 1875584SruYou should have received a copy of the GNU General Public License along 1975584Sruwith groff; see the file COPYING. If not, write to the Free Software 2075584SruFoundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 2175584Sru 2275584Sru 2375584Sruclass reg : public object { 2475584Srupublic: 2575584Sru virtual const char *get_string() = 0; 2675584Sru virtual int get_value(units *); 2775584Sru virtual void increment(); 2875584Sru virtual void decrement(); 2975584Sru virtual void set_increment(units); 3075584Sru virtual void alter_format(char f, int w = 0); 3175584Sru virtual const char *get_format(); 3275584Sru virtual void set_value(units); 3375584Sru}; 3475584Sru 3575584Sruclass constant_int_reg : public reg { 3675584Sru int *p; 3775584Srupublic: 3875584Sru constant_int_reg(int *); 3975584Sru const char *get_string(); 4075584Sru}; 4175584Sru 4275584Sruclass general_reg : public reg { 4375584Sru char format; 4475584Sru int width; 4575584Sru int inc; 4675584Srupublic: 4775584Sru general_reg(); 4875584Sru const char *get_string(); 4975584Sru void increment(); 5075584Sru void decrement(); 5175584Sru void alter_format(char f, int w = 0); 5275584Sru void set_increment(units); 5375584Sru const char *get_format(); 5475584Sru void add_value(units); 5575584Sru 5675584Sru void set_value(units) = 0; 5775584Sru int get_value(units *) = 0; 5875584Sru}; 5975584Sru 6075584Sruclass variable_reg : public general_reg { 6175584Sru units *ptr; 6275584Srupublic: 6375584Sru variable_reg(int *); 6475584Sru void set_value(units); 6575584Sru int get_value(units *); 6675584Sru}; 6775584Sru 6875584Sruextern object_dictionary number_reg_dictionary; 6975584Sruextern void set_number_reg(symbol nm, units n); 7075584Sruextern void check_output_limits(int x, int y); 7175584Sruextern void reset_output_registers (int miny); 7275584Sru 7375584Srureg *lookup_number_reg(symbol); 7475584Sru#if 0 7575584Sruvoid inline_define_reg(); 7675584Sru#endif 77