Imported Upstream version 1.23.0
[platform/upstream/groff.git] / src / roff / troff / troff.h
1 // -*- C++ -*-
2 /* Copyright (C) 1989-2020 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 3 of the License, or
10 (at your option) any later 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
18 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
19
20
21 #include "lib.h"
22
23 #include <assert.h>
24 #include <ctype.h>
25 #include <errno.h>
26 #include <stddef.h>
27 #include <stdlib.h>
28 #include <time.h>
29
30 #include "color.h"
31 #include "device.h"
32 #include "searchpath.h"
33
34 typedef int units;
35
36 extern units scale(units n, units x, units y); // scale n by x/y
37
38 extern units units_per_inch;
39
40 extern int ascii_output_flag;
41 extern int suppress_output_flag;
42 extern int color_flag;
43 extern int is_html;
44
45 extern bool device_has_tcommand;
46 extern int vresolution;
47 extern int hresolution;
48 extern int sizescale;
49
50 extern search_path *mac_path;
51
52 #include "cset.h"
53 #include "cmap.h"
54 #include "errarg.h"
55 #include "error.h"
56
57 enum warning_type {
58   WARN_CHAR = 01,
59   WARN_NUMBER = 02,
60   WARN_BREAK = 04,
61   WARN_DELIM = 010,
62   WARN_EL = 020,
63   WARN_SCALE = 040,
64   WARN_RANGE = 0100,
65   WARN_SYNTAX = 0200,
66   WARN_DI = 0400,
67   WARN_MAC = 01000,
68   WARN_REG = 02000,
69   WARN_TAB = 04000,
70   WARN_RIGHT_BRACE = 010000,
71   WARN_MISSING = 020000,
72   WARN_INPUT = 040000,
73   WARN_ESCAPE = 0100000,
74   WARN_SPACE = 0200000,
75   WARN_FONT = 0400000,
76   WARN_IG =  01000000,
77   WARN_COLOR = 02000000,
78   WARN_FILE = 04000000
79   // change WARN_TOTAL if you add more warning types
80 };
81
82 const int WARN_TOTAL = 07777777;
83
84 int warning(warning_type, const char *,
85             const errarg & = empty_errarg,
86             const errarg & = empty_errarg,
87             const errarg & = empty_errarg);
88 int output_warning(warning_type, const char *,
89                    const errarg & = empty_errarg,
90                    const errarg & = empty_errarg,
91                    const errarg & = empty_errarg);
92
93 // Local Variables:
94 // fill-column: 72
95 // mode: C++
96 // End:
97 // vim: set cindent noexpandtab shiftwidth=2 textwidth=72: