StringInfo Macros

Поиск
Список
Период
Сортировка
Искать
От
Markus Wanner
Тема
StringInfo Macros
Дата
Msg-id
20090828161436.18531ajtsuzgrvws@mail.bluegap.ch
Список
Дерево обсуждения
StringInfo Macros "Markus Wanner" <markus@bluegap.ch>
Re: StringInfo Macros Tom Lane <tgl@sss.pgh.pa.us>
Re: StringInfo Macros Markus Wanner <markus@bluegap.ch>
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




В списке pgsql-hackers по дате отправления
От: Tom Lane
Дата:
Сообщение: Re: Memory context usage
От: Kevin Grittner
Дата:
FAQ