Home | History | Annotate | Line # | Download | only in troff
      1 /*	$NetBSD: troff.h,v 1.1.1.1 2016/01/13 18:41:48 christos Exp $	*/
      2 
      3 // -*- C++ -*-
      4 /* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2004
      5    Free Software Foundation, Inc.
      6      Written by James Clark (jjc (at) jclark.com)
      7 
      8 This file is part of groff.
      9 
     10 groff is free software; you can redistribute it and/or modify it under
     11 the terms of the GNU General Public License as published by the Free
     12 Software Foundation; either version 2, or (at your option) any later
     13 version.
     14 
     15 groff is distributed in the hope that it will be useful, but WITHOUT ANY
     16 WARRANTY; without even the implied warranty of MERCHANTABILITY or
     17 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     18 for more details.
     19 
     20 You should have received a copy of the GNU General Public License along
     21 with groff; see the file COPYING.  If not, write to the Free Software
     22 Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
     23 
     24 
     25 #include "lib.h"
     26 
     27 #include <ctype.h>
     28 #include <time.h>
     29 #include <stddef.h>
     30 #include <stdlib.h>
     31 #include <errno.h>
     32 
     33 #include "assert.h"
     34 #include "color.h"
     35 #include "device.h"
     36 #include "searchpath.h"
     37 
     38 typedef int units;
     39 
     40 extern units scale(units n, units x, units y); // scale n by x/y
     41 
     42 extern units units_per_inch;
     43 
     44 extern int ascii_output_flag;
     45 extern int suppress_output_flag;
     46 extern int color_flag;
     47 extern int is_html;
     48 
     49 extern int tcommand_flag;
     50 extern int vresolution;
     51 extern int hresolution;
     52 extern int sizescale;
     53 
     54 extern search_path *mac_path;
     55 
     56 #include "cset.h"
     57 #include "cmap.h"
     58 #include "errarg.h"
     59 #include "error.h"
     60 
     61 enum warning_type {
     62   WARN_CHAR = 01,
     63   WARN_NUMBER = 02,
     64   WARN_BREAK = 04,
     65   WARN_DELIM = 010,
     66   WARN_EL = 020,
     67   WARN_SCALE = 040,
     68   WARN_RANGE = 0100,
     69   WARN_SYNTAX = 0200,
     70   WARN_DI = 0400,
     71   WARN_MAC = 01000,
     72   WARN_REG = 02000,
     73   WARN_TAB = 04000,
     74   WARN_RIGHT_BRACE = 010000,
     75   WARN_MISSING = 020000,
     76   WARN_INPUT = 040000,
     77   WARN_ESCAPE = 0100000,
     78   WARN_SPACE = 0200000,
     79   WARN_FONT = 0400000,
     80   WARN_IG =  01000000,
     81   WARN_COLOR = 02000000
     82   // change WARN_TOTAL if you add more warning types
     83 };
     84 
     85 const int WARN_TOTAL = 03777777;
     86 
     87 int warning(warning_type, const char *,
     88 	    const errarg & = empty_errarg,
     89 	    const errarg & = empty_errarg,
     90 	    const errarg & = empty_errarg);
     91 int output_warning(warning_type, const char *,
     92 		   const errarg & = empty_errarg,
     93 		   const errarg & = empty_errarg,
     94 		   const errarg & = empty_errarg);
     95