Sync-to-go: update copyright for 2015
[s-roff.git] / src / pre-pic / pic.h
blob24fb3537433ff628cc97d9e35bdd6fcb82159e99
1 /*@
2 * Copyright (c) 2014 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
4 * Copyright (C) 1989 - 1992, 2000, 2001, 2003, 2005
5 * Free Software Foundation, Inc.
6 * Written by James Clark (jjc@jclark.com)
8 * This is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License as published by the Free
10 * Software Foundation; either version 2, or (at your option) any later
11 * version.
13 * This is distributed in the hope that it will be useful, but WITHOUT ANY
14 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with groff; see the file COPYING. If not, write to the Free Software
20 * Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef _PIC_H
23 #define _PIC_H
25 #include "config.h"
26 #include "pic-config.h"
28 #include <errno.h>
29 #include <math.h>
30 #include <stdlib.h>
32 #include "assert.h"
33 #include "cset.h"
34 #include "errarg.h"
35 #include "error.h"
36 #include "file_case.h"
37 #include "lib.h"
38 #include "output.h"
39 #include "position.h"
40 #include "stringclass.h"
41 #include "text.h"
43 #ifndef M_SQRT2 // FIXME lib.h
44 #define M_SQRT2 1.41421356237309504880
45 #endif
47 #ifndef M_PI // FIXME lib.h
48 #define M_PI 3.14159265358979323846
49 #endif
51 class input
53 input *next;
55 public:
56 input();
57 virtual ~input();
58 virtual int get() = 0;
59 virtual int peek() = 0;
60 virtual int get_location(const char **, int *);
61 friend class input_stack;
62 friend class copy_rest_thru_input;
65 class file_input
66 : public input
68 file_case *_fcp;
69 const char *filename;
70 int lineno;
71 string line;
72 const char *ptr;
73 int read_line();
75 public:
76 file_input(file_case *, const char *);
77 ~file_input();
78 int get();
79 int peek();
80 int get_location(const char **, int *);
83 void lex_init(input *);
84 int get_location(char **, int *);
86 void do_copy(const char *file);
87 void parse_init();
88 void parse_cleanup();
90 void lex_error(const char *message,
91 const errarg &arg1 = empty_errarg,
92 const errarg &arg2 = empty_errarg,
93 const errarg &arg3 = empty_errarg);
95 void lex_warning(const char *message,
96 const errarg &arg1 = empty_errarg,
97 const errarg &arg2 = empty_errarg,
98 const errarg &arg3 = empty_errarg);
100 void lex_cleanup();
102 extern int flyback_flag;
103 extern int command_char;
104 // zero_length_line_flag is non-zero if zero-length lines are drawn
105 // as dots by the output device
106 extern int zero_length_line_flag;
107 extern int driver_extension_flag;
108 extern int compatible_flag;
109 extern int safer_flag;
110 extern char *graphname;
112 #endif // _PIC_H
113 // s-it2-mode