home *** CD-ROM | disk | FTP | other *** search
/ Aminet 10 / aminetcdnumber101996.iso / Aminet / util / gnu / groff_src.lha / groff-1.10src / pic / pic.h < prev    next >
C/C++ Source or Header  |  1995-06-22  |  3KB  |  103 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. #include <stdio.h>
  22. #include <string.h>
  23. #include <math.h>
  24. #include <stdlib.h>
  25. #include <errno.h>
  26.  
  27. extern "C" {
  28.   double hypot(double, double);
  29. }
  30.  
  31. #include "assert.h"
  32. #include "cset.h"
  33. #include "lib.h"
  34. #include "stringclass.h"
  35. #include "errarg.h"
  36. #include "error.h"
  37. #include "position.h"
  38. #include "text.h"
  39. #include "output.h"
  40.  
  41. #ifndef M_SQRT2
  42. #define M_SQRT2    1.41421356237309504880
  43. #endif
  44.  
  45. #ifndef M_PI
  46. #define M_PI 3.14159265358979323846
  47. #endif
  48.  
  49. class input {
  50.   input *next;
  51. public:
  52.   input();
  53.   virtual ~input();
  54.   virtual int get() = 0;
  55.   virtual int peek() = 0;
  56.   virtual int get_location(const char **, int *);
  57.   friend class input_stack;
  58.   friend class copy_rest_thru_input;
  59. };
  60.  
  61. class file_input : public input {
  62.   FILE *fp;
  63.   const char *filename;
  64.   int lineno;
  65.   string line;
  66.   const char *ptr;
  67.   int read_line();
  68. public:
  69.   file_input(FILE *, const char *);
  70.   ~file_input();
  71.   int get();
  72.   int peek();
  73.   int get_location(const char **, int *);
  74. };
  75.  
  76. void lex_init(input *);
  77. int get_location(char **, int *);
  78.  
  79. void do_copy(const char *file);
  80. void parse_init();
  81. void parse_cleanup();
  82.  
  83. void lex_error(const char *message,
  84.            const errarg &arg1 = empty_errarg,
  85.            const errarg &arg2 = empty_errarg,
  86.            const errarg &arg3 = empty_errarg);
  87.  
  88. void lex_warning(const char *message,
  89.          const errarg &arg1 = empty_errarg,
  90.          const errarg &arg2 = empty_errarg,
  91.          const errarg &arg3 = empty_errarg);
  92.  
  93. void lex_cleanup();
  94.  
  95. extern int flyback_flag;
  96. extern int command_char;
  97. // zero_length_line_flag is non-zero if zero-length lines are drawn 
  98. // as dots by the output device
  99. extern int zero_length_line_flag;
  100. extern int driver_extension_flag;
  101. extern int compatible_flag;
  102. extern int safer_flag;
  103.