1 // -*- C++ -*- 2 /* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002 3 Free Software Foundation, Inc. 4 Written by James Clark (jjc@jclark.com) 5 6 This file is part of groff. 7 8 groff 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. 12 13 groff 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. 17 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 21 22 23 #include "lib.h" 24 25 #include <ctype.h> 26 #include <time.h> 27 #include <stddef.h> 28 #include <stdlib.h> 29 #include <errno.h> 30 31 #include "encoding.h" 32 #include "assert.h" 33 #include "color.h" 34 #include "device.h" 35 #include "searchpath.h" 36 37 void cleanup_and_exit(int n); 38 39 typedef int units; 40 41 extern units scale(units n, units x, units y); // scale n by x/y 42 43 extern units units_per_inch; 44 45 extern int ascii_output_flag; 46 extern int suppress_output_flag; 47 extern int color_flag; 48 extern int is_html; 49 50 extern int tcommand_flag; 51 extern int vresolution; 52 extern int hresolution; 53 extern int sizescale; 54 55 extern search_path *mac_path; 56 57 #include "cset.h" 58 #include "cmap.h" 59 #include "errarg.h" 60 #include "error.h" 61 62 enum warning_type { 63 WARN_CHAR = 01, 64 WARN_NUMBER = 02, 65 WARN_BREAK = 04, 66 WARN_DELIM = 010, 67 WARN_EL = 020, 68 WARN_SCALE = 040, 69 WARN_RANGE = 0100, 70 WARN_SYNTAX = 0200, 71 WARN_DI = 0400, 72 WARN_MAC = 01000, 73 WARN_REG = 02000, 74 WARN_TAB = 04000, 75 WARN_RIGHT_BRACE = 010000, 76 WARN_MISSING = 020000, 77 WARN_INPUT = 040000, 78 WARN_ESCAPE = 0100000, 79 WARN_SPACE = 0200000, 80 WARN_FONT = 0400000, 81 WARN_IG = 01000000, 82 WARN_COLOR = 02000000 83 // change WARN_TOTAL if you add more warning types 84 }; 85 86 const int WARN_TOTAL = 02777777; 87 88 int warning(warning_type, const char *, 89 const errarg & = empty_errarg, 90 const errarg & = empty_errarg, 91 const errarg & = empty_errarg); 92 int output_warning(warning_type, const char *, 93 const errarg & = empty_errarg, 94 const errarg & = empty_errarg, 95 const errarg & = empty_errarg); 96