From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- dviware/dvi2bitmap/DviError.cc | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 dviware/dvi2bitmap/DviError.cc (limited to 'dviware/dvi2bitmap/DviError.cc') diff --git a/dviware/dvi2bitmap/DviError.cc b/dviware/dvi2bitmap/DviError.cc new file mode 100644 index 0000000000..ba5b126d3f --- /dev/null +++ b/dviware/dvi2bitmap/DviError.cc @@ -0,0 +1,45 @@ +/* This file is part of dvi2bitmap; see README for copyrights and licence */ + +#include + +#ifdef HAVE_CSTD_INCLUDE +#include +#include +#include // for strlen +#else +#include +#include +#include +#endif +#include +#include + +#include "DviError.h" + +DviError::DviError(const char *fmt,...) +{ + char *p = new char[2*STD::strlen(fmt)]; + va_list ap; + va_start(ap,fmt); + STD::vsprintf (p, fmt, ap); + va_end(ap); + problem_ = p; + delete[] p; +} + +void DviError::print() const { + STD::cerr << "DVI error: " << problem_ << STD::endl; } +void DviBug::print() const { + STD::cerr << "BUG: " << problem_ << STD::endl; } + +DviBug::DviBug(const char *fmt,...) +{ + char *p = new char[2*STD::strlen(fmt)]; + va_list ap; + va_start(ap,fmt); + vsprintf (p, fmt, ap); + va_end(ap); + problem_ = p; + delete[] p; +} + -- cgit v1.2.3