Hi,
trying to clean up the Postgres-R code further, I would like to make
use of StringInfo and accompanying functions in libpq/pqformat.c
instead of some home-brown duplicate of it. However, I'm missing
helper macros like these (mainly for readability of the code):
#define BUFFER_START_PTR(buffer) ((buffer)->data))
#define BUFFER_END_PTR(buffer) ((buffer)->data + (buffer)->len)
#define BUFFER_CURSOR_PTR(buffer) ((buffer)->data + (buffer)->cursor)
#define BUFFER_BYTES_FREE(buffer) ((buffer)->maxlen - (buffer)->len)
#define BUFFER_BYTES_READABLE(buffer) ((buffer)->len - (buffer)->cursor)
Is there any compelling reason these don't exist (and shouldn't get
added)? IF not, I'd be happy to create a patch to add and make use of
such macros.
Regards
Markus Wanner