PostGIS  2.1.10dev-r@@SVN_REVISION@@
static int append_stringbuffer ( STRINGBUFFER buffer,
const char *  str 
)
static

Definition at line 799 of file raster2pgsql.c.

References _, stringbuffer_t::length, stringbuffer_t::line, rtalloc(), rterror(), and rtrealloc().

Referenced by append_sql_to_buffer(), build_overview(), and convert_raster().

799  {
800  buffer->length++;
801 
802  buffer->line = rtrealloc(buffer->line, sizeof(char *) * buffer->length);
803  if (buffer->line == NULL) {
804  rterror(_("append_stringbuffer: Could not allocate memory for appending string to buffer"));
805  return 0;
806  }
807 
808  buffer->line[buffer->length - 1] = NULL;
809  buffer->line[buffer->length - 1] = rtalloc(sizeof(char) * (strlen(str) + 1));
810  if (buffer->line[buffer->length - 1] == NULL) {
811  rterror(_("append_stringbuffer: Could not allocate memory for appending string to buffer"));
812  return 0;
813  }
814  strcpy(buffer->line[buffer->length - 1], str);
815 
816  return 1;
817 }
#define _(String)
Definition: shpcommon.h:23
uint32_t length
Definition: raster2pgsql.h:191
void * rtalloc(size_t size)
Raster core memory management functions.
Definition: rt_api.c:867
void rterror(const char *fmt,...)
Raster core error and info handlers.
Definition: rt_api.c:895
void * rtrealloc(void *mem, size_t size)
Definition: rt_api.c:875

Here is the call graph for this function:

Here is the caller graph for this function: