Skip site navigation (1) Skip section navigation (2)

StringInfo Macros

From: "Markus Wanner" <markus(at)bluegap(dot)ch>
To: pgsql-hackers(at)postgresql(dot)org
Subject: StringInfo Macros
Date: 2009-08-28 14:14:36
Message-ID: 20090828161436.18531ajtsuzgrvws@mail.bluegap.ch (view raw or flat)
Thread:
Lists: pgsql-hackers
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




Responses

pgsql-hackers by date

Next:From: Kevin GrittnerDate: 2009-08-28 14:30:51
Subject: Re: patch: Review handling of MOVE and FETCH (ToDo)
Previous:From: Tom LaneDate: 2009-08-28 14:00:46
Subject: Re: Memory context usage

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group