2 /* Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc.
3 Written by James Clark (jjc@jclark.uucp)
5 This file is part of groff.
7 groff is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 1, or (at your option) any later
12 groff is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License along
18 with groff; see the file LICENSE. If not, write to the Free Software
19 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
25 errarg::errarg(const char *p
) : s(p
== 0 ? "(null)" : p
), type(STRING
)
29 errarg::errarg() : type(EMPTY
)
33 errarg::errarg(unsigned char cc
) : type(CHAR
)
38 errarg::errarg(int nn
) : type(INTEGER
), n(nn
)
42 errarg::errarg(char cc
) : type(CHAR
), c(cc
)
46 errarg::errarg(double dd
) : type(DOUBLE
), d(dd
)
50 int errarg::empty() const
56 const char *itoa(int);
59 void errarg::print() const
63 fputs(itoa(n
), stderr
);
72 fprintf(stderr
, "%g", d
);
81 void errprint(const char *format
,
88 while ((c
= *format
++) != '\0') {
96 assert(!arg1
.empty());
100 assert(!arg2
.empty());
104 assert(!arg3
.empty());