Re: [PATCHES] resetStringInfo

2007-03-03 Thread Neil Conway
On Sat, 2007-03-03 at 15:04 -0300, Alvaro Herrera wrote: > I think this is the reason why struct members are prefixed with some > short form of the struct name; for example struct timeval has tv_sec and > tv_usec. This is used in a lot of places in our code. Maybe it would > be a good idea to mak

Re: [PATCHES] resetStringInfo

2007-03-03 Thread Neil Conway
On Sat, 2007-03-03 at 10:57 -0800, Joe Conway wrote: > I have used pfree(var.data) combined with initStringInfo(&var) in a few > places (e.g. in tablefunc.c). Thanks, fixed. I also did a bit more searching and found some more places where resetStringInfo() could be used to replace the previous cu

Re: [PATCHES] resetStringInfo

2007-03-03 Thread Joe Conway
Tom Lane wrote: Neil Conway <[EMAIL PROTECTED]> writes: Attached is a patch that makes a minor addition to the StringInfo API: resetStringInfo(), which clears the current content of the StringInfo but leaves it valid for future operations. I needed this for an external project, but ISTM this

Re: [PATCHES] resetStringInfo

2007-03-03 Thread Alvaro Herrera
Neil Conway wrote: > On Sat, 2007-03-03 at 11:23 -0500, Bruce Momjian wrote: > > Are there any places in our code where we could use it? > > I manually grep'ed around and found a few places where resetStringInfo > can be used, but I probably didn't find them all: it's quite hard to > find all the

Re: [PATCHES] resetStringInfo

2007-03-03 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > Attached is a patch that makes a minor addition to the StringInfo API: > resetStringInfo(), which clears the current content of the StringInfo > but leaves it valid for future operations. > I needed this for an external project, but ISTM this would be wort

Re: [PATCHES] resetStringInfo

2007-03-03 Thread Neil Conway
On Sat, 2007-03-03 at 11:23 -0500, Bruce Momjian wrote: > Are there any places in our code where we could use it? I manually grep'ed around and found a few places where resetStringInfo can be used, but I probably didn't find them all: it's quite hard to find all the places in which "StringInfo->le

Re: [PATCHES] resetStringInfo

2007-03-03 Thread Bruce Momjian
Are there any places in our code where we could use it? If so, please add that to the patch. --- Neil Conway wrote: > Attached is a patch that makes a minor addition to the StringInfo API: > resetStringInfo(), which clears