errarg.h revision 151498
152942Sbrian// -*- C++ -*-
252942Sbrian/* Copyright (C) 1989, 1990, 1991, 1992, 2002 Free Software Foundation, Inc.
352942Sbrian     Written by James Clark (jjc@jclark.com)
452942Sbrian
552942SbrianThis file is part of groff.
652942Sbrian
752942Sbriangroff is free software; you can redistribute it and/or modify it under
852942Sbrianthe terms of the GNU General Public License as published by the Free
952942SbrianSoftware Foundation; either version 2, or (at your option) any later
1052942Sbrianversion.
1152942Sbrian
1252942Sbriangroff is distributed in the hope that it will be useful, but WITHOUT ANY
1352942SbrianWARRANTY; without even the implied warranty of MERCHANTABILITY or
1452942SbrianFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1552942Sbrianfor more details.
1652942Sbrian
1752942SbrianYou should have received a copy of the GNU General Public License along
1852942Sbrianwith groff; see the file COPYING.  If not, write to the Free Software
1952942SbrianFoundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
2052942Sbrian
2152942Sbrianclass errarg {
2252942Sbrian  enum { EMPTY, STRING, CHAR, INTEGER, UNSIGNED_INTEGER, DOUBLE } type;
2352942Sbrian  union {
2452942Sbrian    const char *s;
2552942Sbrian    int n;
2652942Sbrian    unsigned int u;
2752942Sbrian    char c;
2852942Sbrian    double d;
2952942Sbrian  };
3052942Sbrian public:
3152942Sbrian  errarg();
3252942Sbrian  errarg(const char *);
3352942Sbrian  errarg(char);
3452942Sbrian  errarg(unsigned char);
3552942Sbrian  errarg(int);
3652942Sbrian  errarg(unsigned int);
3752942Sbrian  errarg(double);
3852942Sbrian  int empty() const;
3952942Sbrian  void print() const;
4052942Sbrian};
4152942Sbrian
4252942Sbrianextern errarg empty_errarg;
4352942Sbrian
4452942Sbrianextern void errprint(const char *,
4552942Sbrian		     const errarg &arg1 = empty_errarg,
4652942Sbrian		     const errarg &arg2 = empty_errarg,
4752942Sbrian		     const errarg &arg3 = empty_errarg);
4852942Sbrian