home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.bin / groff / pic / pic.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-04-30  |  2.3 KB  |  95 lines

  1. // -*- C++ -*-
  2. /* Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc.
  3.      Written by James Clark (jjc@jclark.uucp)
  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 1, 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 LICENSE.  If not, write to the Free Software
  19. Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
  20.  
  21. #include <stdio.h>
  22. #include <string.h>
  23. #include <math.h>
  24. #include <stdlib.h>
  25. #include <osfcn.h>
  26. #include <errno.h>
  27.  
  28. #include "assert.h"
  29. #include "cset.h"
  30. #include "lib.h"
  31. #include "stringclass.h"
  32. #include "errarg.h"
  33. #include "error.h"
  34. #include "position.h"
  35. #include "text.h"
  36. #include "output.h"
  37.  
  38. #ifndef M_SQRT2
  39. #define M_SQRT2    1.41421356237309504880
  40. #endif
  41.  
  42. class input {
  43.   input *next;
  44. public:
  45.   input();
  46.   virtual ~input();
  47.   virtual int get() = 0;
  48.   virtual int peek() = 0;
  49.   virtual int get_location(const char **, int *);
  50.   friend class input_stack;
  51.   friend class copy_rest_thru_input;
  52. };
  53.  
  54. class file_input : public input {
  55.   FILE *fp;
  56.   const char *filename;
  57.   int lineno;
  58.   string line;
  59.   const char *ptr;
  60.   int read_line();
  61. public:
  62.   file_input(FILE *, const char *);
  63.   ~file_input();
  64.   int get();
  65.   int peek();
  66.   int get_location(const char **, int *);
  67. };
  68.  
  69. void lex_init(input *);
  70. int get_location(char **, int *);
  71.  
  72. void do_copy(const char *file);
  73. void parse_init();
  74. void parse_cleanup();
  75.  
  76. void lex_error(const char *message,
  77.            const errarg &arg1 = empty_errarg,
  78.            const errarg &arg2 = empty_errarg,
  79.            const errarg &arg3 = empty_errarg);
  80.  
  81. void lex_warning(const char *message,
  82.          const errarg &arg1 = empty_errarg,
  83.          const errarg &arg2 = empty_errarg,
  84.          const errarg &arg3 = empty_errarg);
  85.  
  86. void lex_cleanup();
  87.  
  88. extern int flyback_flag;
  89. extern int command_char;
  90. // zero_length_line_flag is non-zero if zero-length lines are drawn 
  91. // as dots by the output device
  92. extern int zero_length_line_flag;
  93. extern int driver_extension_flag;
  94. extern int compatible_flag;
  95.