#undef PUT_CHAR
#undef SAVE_PFXTAIL
-/*----- Skeleton ----------------------------------------------------------*/
-/*
-static void ..._bsession(struct tvec_output *o, struct tvec_state *tv)
-static int ..._esession(struct tvec_output *o)
-static void ..._bgroup(struct tvec_output *o)
-static void ..._skipgroup(struct tvec_output *o,
- const char *excuse, va_list *ap)
-static void ..._egroup(struct tvec_output *o)
-static void ..._btest(struct tvec_output *o)
-static void ..._skip(struct tvec_output *o, const char *excuse, va_list *ap)
-static void ..._fail(struct tvec_output *o, const char *detail, va_list *ap)
-static void ..._dumpreg(struct tvec_output *o, unsigned disp,
- union tvec_regval *rv, const struct tvec_regdef *rd)
-static void ..._etest(struct tvec_output *o, unsigned outcome)
-static void ..._bbench(struct tvec_output *o,
- const char *ident, unsigned unit)
-static void ..._ebench(struct tvec_output *o,
- const char *ident, unsigned unit,
- const struct tvec_timing *t)
-static void ..._error(struct tvec_output *o, const char *msg, va_list *ap)
-static void ..._notice(struct tvec_output *o, const char *msg, va_list *ap)
-static void ..._destroy(struct tvec_output *o)
-
-static const struct tvec_outops ..._ops = {
- ..._bsession, ..._esession,
- ..._bgroup, ..._egroup, ..._skip,
- ..._btest, ..._skip, ..._fail, ..._dumpreg, ..._etest,
- ..._bbench, ..._ebench,
- ..._error, ..._notice,
- ..._destroy
-};
-*/
/*----- Human-readable output ---------------------------------------------*/
/* Attributes for colour output. This should be done better, but @terminfo@
va_start(ap, p);
n = gprintf_memputf(&h->outbuf, &h->outsz, maxsz, p, ap);
va_end(ap);
- return (layout_string(&h->lyt, h->outbuf, n));
+ if (layout_string(&h->lyt, h->outbuf, n)) return (-1);
+ return (n);
}
static const struct gprintf_ops human_printops =
*/
static int tap_writech(void *go, int ch)
- { struct tap_output *t = go; return (layout_char(&t->lyt, ch)); }
+{
+ struct tap_output *t = go;
+
+ if (layout_char(&t->lyt, ch)) return (-1);
+ else return (1);
+}
static int tap_writem(void *go, const char *p, size_t sz)
- { struct tap_output *t = go; return (layout_string(&t->lyt, p, sz)); }
+{
+ struct tap_output *t = go;
+
+ if (layout_string(&t->lyt, p, sz)) return (-1);
+ else return (sz);
+}
static int tap_nwritef(void *go, size_t maxsz, const char *p, ...)
{
va_start(ap, p);
n = gprintf_memputf(&t->outbuf, &t->outsz, maxsz, p, ap);
va_end(ap);
- return (layout_string(&t->lyt, t->outbuf, n));
+ if (layout_string(&t->lyt, t->outbuf, n)) return (-1);
+ return (n);
}
static const struct gprintf_ops tap_printops =