175584Sru// -*- C++ -*-
2151497Sru/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2004
375584Sru   Free Software Foundation, Inc.
475584Sru     Written by James Clark (jjc@jclark.com)
575584Sru
675584SruThis file is part of groff.
775584Sru
875584Srugroff is free software; you can redistribute it and/or modify it under
975584Sruthe terms of the GNU General Public License as published by the Free
1075584SruSoftware Foundation; either version 2, or (at your option) any later
1175584Sruversion.
1275584Sru
1375584Srugroff is distributed in the hope that it will be useful, but WITHOUT ANY
1475584SruWARRANTY; without even the implied warranty of MERCHANTABILITY or
1575584SruFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1675584Srufor more details.
1775584Sru
1875584SruYou should have received a copy of the GNU General Public License along
1975584Sruwith groff; see the file COPYING.  If not, write to the Free Software
20151497SruFoundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
2175584Sru
2275584Sru
23104862Sru#include "lib.h"
24104862Sru
2575584Sru#include <ctype.h>
2675584Sru#include <time.h>
2775584Sru#include <stddef.h>
2875584Sru#include <stdlib.h>
2975584Sru#include <errno.h>
3075584Sru
3175584Sru#include "assert.h"
32104862Sru#include "color.h"
3375584Sru#include "device.h"
3475584Sru#include "searchpath.h"
3575584Sru
3675584Srutypedef int units;
3775584Sru
3875584Sruextern units scale(units n, units x, units y); // scale n by x/y
3975584Sru
4075584Sruextern units units_per_inch;
4175584Sru
4275584Sruextern int ascii_output_flag;
4375584Sruextern int suppress_output_flag;
44104862Sruextern int color_flag;
4575584Sruextern int is_html;
4675584Sru
4775584Sruextern int tcommand_flag;
4875584Sruextern int vresolution;
4975584Sruextern int hresolution;
5075584Sruextern int sizescale;
5175584Sru
5275584Sruextern search_path *mac_path;
5375584Sru
5475584Sru#include "cset.h"
5575584Sru#include "cmap.h"
5675584Sru#include "errarg.h"
5775584Sru#include "error.h"
5875584Sru
5975584Sruenum warning_type {
6075584Sru  WARN_CHAR = 01,
6175584Sru  WARN_NUMBER = 02,
6275584Sru  WARN_BREAK = 04,
6375584Sru  WARN_DELIM = 010,
6475584Sru  WARN_EL = 020,
6575584Sru  WARN_SCALE = 040,
6675584Sru  WARN_RANGE = 0100,
6775584Sru  WARN_SYNTAX = 0200,
6875584Sru  WARN_DI = 0400,
6975584Sru  WARN_MAC = 01000,
7075584Sru  WARN_REG = 02000,
7175584Sru  WARN_TAB = 04000,
7275584Sru  WARN_RIGHT_BRACE = 010000,
7375584Sru  WARN_MISSING = 020000,
7475584Sru  WARN_INPUT = 040000,
7575584Sru  WARN_ESCAPE = 0100000,
7675584Sru  WARN_SPACE = 0200000,
7775584Sru  WARN_FONT = 0400000,
78104862Sru  WARN_IG =  01000000,
79104862Sru  WARN_COLOR = 02000000
8075584Sru  // change WARN_TOTAL if you add more warning types
8175584Sru};
8275584Sru
83151497Sruconst int WARN_TOTAL = 03777777;
8475584Sru
8575584Sruint warning(warning_type, const char *,
8675584Sru	    const errarg & = empty_errarg,
8775584Sru	    const errarg & = empty_errarg,
8875584Sru	    const errarg & = empty_errarg);
89104862Sruint output_warning(warning_type, const char *,
90104862Sru		   const errarg & = empty_errarg,
91104862Sru		   const errarg & = empty_errarg,
92104862Sru		   const errarg & = empty_errarg);
93