93 if (
str->data == NULL)
185 if (needed >= ((
size_t) INT_MAX -
str->len))
191 needed +=
str->len + 1;
195 if (needed <= str->maxlen)
203 newlen = (
str->maxlen > 0) ? (2 *
str->maxlen) : 64;
204 while (needed > newlen)
212 if (newlen > (
size_t) INT_MAX)
213 newlen = (
size_t) INT_MAX;
215 newdata = (
char *)
realloc(
str->data, newlen);
219 str->maxlen = newlen;
237 int save_errno = errno;
267 int save_errno = errno;
304 if (
str->maxlen >
str->len + 16)
306 avail =
str->maxlen -
str->len;
320 if ((
size_t) nprinted < avail)
323 str->len += nprinted;
335 if (
unlikely(nprinted > INT_MAX - 1))
340 needed = nprinted + 1;
387 str->data[
str->len] =
'\0';
411 str->data[
str->len] =
'\0';
#define unconstify(underlying_type, expr)
static void PGresult * res
static void const char * fmt
void printfPQExpBuffer(PQExpBuffer str, const char *fmt,...)
PQExpBuffer createPQExpBuffer(void)
void initPQExpBuffer(PQExpBuffer str)
int enlargePQExpBuffer(PQExpBuffer str, size_t needed)
void resetPQExpBuffer(PQExpBuffer str)
void appendPQExpBuffer(PQExpBuffer str, const char *fmt,...)
void appendBinaryPQExpBuffer(PQExpBuffer str, const char *data, size_t datalen)
void destroyPQExpBuffer(PQExpBuffer str)
static const char *const oom_buffer_ptr
static const char oom_buffer[1]
bool appendPQExpBufferVA(PQExpBuffer str, const char *fmt, va_list args)
void appendPQExpBufferChar(PQExpBuffer str, char ch)
void appendPQExpBufferStr(PQExpBuffer str, const char *data)
void termPQExpBuffer(PQExpBuffer str)
static void markPQExpBufferBroken(PQExpBuffer str)
#define PQExpBufferBroken(str)
PQExpBufferData * PQExpBuffer
#define INITIAL_EXPBUFFER_SIZE