96 int save_errno = errno;
148 avail =
str->maxlen -
str->len;
154 if (nprinted < (
size_t) avail)
157 str->len += (int) nprinted;
162 str->data[
str->len] =
'\0';
169 return (
int) nprinted;
194 if (
str->len + 1 >=
str->maxlen)
200 str->data[
str->len] =
'\0';
217 memset(&
str->data[
str->len],
' ', count);
219 str->data[
str->len] =
'\0';
246 str->data[
str->len] =
'\0';
300 elog(
ERROR,
"invalid string enlargement request size: %d", needed);
302 fprintf(stderr,
"invalid string enlargement request size: %d\n", needed);
310 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
312 errdetail(
"Cannot enlarge string buffer containing %d bytes by %d more bytes.",
316 _(
"string buffer exceeds maximum allowed length (%zu bytes)\n\nCannot enlarge string buffer containing %d bytes by %d more bytes.\n"),
322 needed +=
str->len + 1;
326 if (needed <= str->maxlen)
334 newlen = 2 *
str->maxlen;
335 while (needed > newlen)
348 str->maxlen = newlen;
#define Assert(condition)
#define fprintf(file, fmt, msg)
static void PGresult * res
int errdetail(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
static void const char * fmt
void * repalloc(void *pointer, Size size)
void pfree(void *pointer)
size_t pvsnprintf(char *buf, size_t len, const char *fmt, va_list args)
static pg_noinline void Size size
int appendStringInfoVA(StringInfo str, const char *fmt, va_list args)
void destroyStringInfo(StringInfo str)
StringInfo makeStringInfo(void)
void resetStringInfo(StringInfo str)
void appendStringInfo(StringInfo str, const char *fmt,...)
void enlargeStringInfo(StringInfo str, int needed)
void appendBinaryStringInfoNT(StringInfo str, const void *data, int datalen)
void appendBinaryStringInfo(StringInfo str, const void *data, int datalen)
void appendStringInfoSpaces(StringInfo str, int count)
void appendStringInfoString(StringInfo str, const char *s)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
StringInfoData * StringInfo