errarg.h 603 B

12345678910111213141516171819202122232425262728293031
  1. // -*- C++ -*-
  2. // Declarations etc. related to the errarg class, defined in libgroff/errarg.c.
  3. class errarg {
  4. public:
  5. errarg();
  6. errarg(const char *);
  7. errarg(char);
  8. errarg(unsigned char);
  9. errarg(int);
  10. errarg(double);
  11. int empty() const;
  12. void print() const;
  13. private:
  14. enum { EMPTY, STRING, CHAR, INTEGER, DOUBLE } type;
  15. union {
  16. const char *s;
  17. int n;
  18. char c;
  19. double d;
  20. };
  21. };
  22. extern errarg empty_errarg;
  23. extern void errprint(const char *,
  24. const errarg &arg1 = empty_errarg,
  25. const errarg &arg2 = empty_errarg,
  26. const errarg &arg3 = empty_errarg);