summaryrefslogtreecommitdiff
path: root/src/roff/troff/troff.h
blob: 793ac19ffabbef87962836e91ea4eb32aa14ab0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// -*- C++ -*-
/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
     Written by James Clark (jjc@jclark.com)

This file is part of groff.

groff is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or
(at your option) any later version.

groff is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>. */


#include "lib.h"

#include <ctype.h>
#include <time.h>
#include <stddef.h>
#include <stdlib.h>
#include <errno.h>

#include "assert.h"
#include "color.h"
#include "device.h"
#include "searchpath.h"

typedef int units;

extern units scale(units n, units x, units y); // scale n by x/y

extern units units_per_inch;

extern int ascii_output_flag;
extern int suppress_output_flag;
extern int color_flag;
extern int is_html;

extern bool device_has_tcommand;
extern int vresolution;
extern int hresolution;
extern int sizescale;

extern search_path *mac_path;

#include "cset.h"
#include "cmap.h"
#include "errarg.h"
#include "error.h"

enum warning_type {
  WARN_CHAR = 01,
  WARN_NUMBER = 02,
  WARN_BREAK = 04,
  WARN_DELIM = 010,
  WARN_EL = 020,
  WARN_SCALE = 040,
  WARN_RANGE = 0100,
  WARN_SYNTAX = 0200,
  WARN_DI = 0400,
  WARN_MAC = 01000,
  WARN_REG = 02000,
  WARN_TAB = 04000,
  WARN_RIGHT_BRACE = 010000,
  WARN_MISSING = 020000,
  WARN_INPUT = 040000,
  WARN_ESCAPE = 0100000,
  WARN_SPACE = 0200000,
  WARN_FONT = 0400000,
  WARN_IG =  01000000,
  WARN_COLOR = 02000000,
  WARN_FILE = 04000000
  // change WARN_TOTAL if you add more warning types
};

const int WARN_TOTAL = 07777777;

int warning(warning_type, const char *,
	    const errarg & = empty_errarg,
	    const errarg & = empty_errarg,
	    const errarg & = empty_errarg);
int output_warning(warning_type, const char *,
		   const errarg & = empty_errarg,
		   const errarg & = empty_errarg,
		   const errarg & = empty_errarg);

// Local Variables:
// fill-column: 72
// mode: C++
// End:
// vim: set cindent noexpandtab shiftwidth=2 textwidth=72: