int nline = 0, nshapes = 0, len, xs, ys;
if ((fh = fopen(DATA_SHAPESPATH, "r")) == NULL)
- err(EXIT_FAILURE, "Cannot open %s", DATA_SHAPESPATH);
+ screen_error("Cannot open %s", DATA_SHAPESPATH);
/* About current shape */
rarray_t tlines, flines, blines, alines;
continue;
}
- err(EXIT_FAILURE,
- "Unexpected shape format line %d in %s",
+ screen_error("Unexpected shape format line %d in %s",
nline, DATA_SHAPESPATH);
}
/* Process lines and create new shape instance */
if (tlines.count < 1)
- err(EXIT_FAILURE, "Empty shape %d in %s line %d",
+ screen_error("Empty shape %d in %s line %d",
nshapes, DATA_SHAPESPATH, nline);
if ((flines.count > 0 && flines.count != tlines.count) ||
(blines.count > 0 && blines.count != tlines.count) ||
(alines.count > 0 && alines.count != tlines.count))
- err(EXIT_FAILURE,
+ screen_error(
"F B A present but not matching T lines count %d "
"for shape %d at line %d in %s",
tlines.count, nshapes, nline, DATA_SHAPESPATH);
/* Allocate new pad */
if ((pad = newpad(ys, xs)) == NULL)
- err(EXIT_FAILURE, "newpad()");
+ screen_error("newpad()");
(void)werase(pad);
/* Fill with characters marked with attributes as needed */
rarray_destroy(&alines);
if (nshapes != SHAPE_MAX)
- err(EXIT_FAILURE, "Shapes short count in %s "
+ screen_error("Shapes short count in %s "
"(expected %d, read %d).", DATA_SHAPESPATH, SHAPE_MAX,
nshapes);