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