home *** CD-ROM | disk | FTP | other *** search
/ Aminet 10 / aminetcdnumber101996.iso / Aminet / util / gnu / groff_src.lha / groff-1.10src / troff / reg.h < prev    next >
C/C++ Source or Header  |  1995-06-22  |  2KB  |  74 lines

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