+/*
+ * xc_foreach_seq(xc, int, unsigned, unsigned, unsigned, uint_fast32_t)
+ *
+ * Helper macro to iterate through the display sequence. The first argument is
+ * a pointer to the state structure. The remaining 5 arguments are lvalues of
+ * the given type designating objects that are updated on each iteration.
+ *
+ * i - index into the sequence
+ * out_x - x position for drawing of this element
+ * src_x - x position in the pixmap of this element
+ * w - width of this element
+ * mask - shifted left by 1 each iteration
+ */
+#define xc_foreach_seq(xc, i, out_x, src_x, w, mask) for \
+ ( (out_x) = MARGIN, (i) = 0 \
+ ; (i) < sizeof (xc)->seq \
+ && xc_seq_iter(xc, i, &(src_x), &(w), &(mask)) \
+ ; (i)++, (out_x) += (w) )
+
+/*
+ * Redraw the changed portion of the text. The mask bitmap indicates which
+ * elements of the sequence to redraw, with bit 0 corresponding to the last
+ * possible element, bit 1 the second last, and so on.
+ */
+static void xc_redraw(struct xcounter *xc, uint_fast32_t mask)