PostGIS  2.2.7dev-r@@SVN_REVISION@@
static int pgui_copy_write ( const char *  line)
static

Definition at line 370 of file shp2pgsql-gui.c.

References pg_connection, and pgui_logf().

Referenced by pgui_action_import().

371 {
372  char line_trunc[256];
373 
374  /* We need a connection to do anything. */
375  if ( ! pg_connection ) return 0;
376  if ( ! line ) return 0;
377 
378  /* Did something unexpected happen? */
379  if ( PQputCopyData(pg_connection, line, strlen(line)) < 0 )
380  {
381  /* Log errors and return failure. */
382  snprintf(line_trunc, 255, "%s", line);
383  pgui_logf("Failed row begins: \"%s\"", line_trunc);
384  pgui_logf("Failed in pgui_copy_write(): %s", PQerrorMessage(pg_connection));
385  return 0;
386  }
387 
388  /* Send linefeed to signify end of line */
389  PQputCopyData(pg_connection, "\n", 1);
390 
391  return 1;
392 }
static void pgui_logf(const char *fmt,...)
static PGconn * pg_connection

Here is the call graph for this function:

Here is the caller graph for this function: