-#define CONBUF_LINES_IDX(buf, i) (((buf)->lines_first + (i)) % (buf)->maxlines)
-#define CONBUF_LINES_UNIDX(buf, i) (((i) - (buf)->lines_first + (buf)->maxlines) % (buf)->maxlines)
-#define CONBUF_LINES_LAST(buf) CONBUF_LINES_IDX(buf, (buf)->lines_count - 1)
-#define CONBUF_LINES(buf, i) (buf)->lines[CONBUF_LINES_IDX(buf, i)]
-#define CONBUF_LINES_PRED(buf, i) (((i) + (buf)->maxlines - 1) % (buf)->maxlines)
-#define CONBUF_LINES_SUCC(buf, i) (((i) + 1) % (buf)->maxlines)
+#define CONBUFFER_LINES(buf, i) (buf)->lines[((buf)->lines_first + (i)) % (buf)->maxlines]
+#define CONBUFFER_LINES_COUNT(buf) ((buf)->lines_count)
+#define CONBUFFER_LINES_LAST(buf) CONBUFFER_LINES(buf, CONBUFFER_LINES_COUNT(buf) - 1)