PostGIS  2.2.7dev-r@@SVN_REVISION@@
int main ( int  argc,
char *  argv[] 
)

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

References shp_loader_config::createindex, shp_connection_state::database, shp_loader_config::dump_format, free(), shp_loader_config::geo_col, GEOMETRY_DEFAULT, shp_connection_state::host, malloc(), shp_connection_state::password, pgis_getopt(), pgis_optarg, pgui_create_about_dialog(), pgui_create_connection_window(), pgui_create_dumper_options_dialog(), pgui_create_filechooser_dialog(), pgui_create_folderchooser_dialog(), pgui_create_loader_options_dialog(), pgui_create_main_window(), pgui_create_progress_dialog(), pgui_create_tablechooser_dialog(), shp_connection_state::port, set_dumper_config_defaults(), set_loader_config_defaults(), usage(), and shp_connection_state::username.

3457 {
3458  int c;
3459 
3460 #ifdef ENABLE_NLS
3461  setlocale (LC_ALL, "");
3462  bindtextdomain (PACKAGE, PGSQL_LOCALEDIR);
3463  textdomain (PACKAGE);
3464 #endif
3465 
3466  /* Parse command line options and set configuration */
3471 
3472  /* Here we override any defaults for the GUI */
3476 
3477  conn = malloc(sizeof(SHPCONNECTIONCONFIG));
3478  memset(conn, 0, sizeof(SHPCONNECTIONCONFIG));
3479 
3480  /* Here we override any defaults for the connection */
3481  conn->host = strdup("localhost");
3482  conn->port = strdup("5432");
3483 
3484  while ((c = pgis_getopt(argc, argv, "U:p:W:d:h:")) != -1)
3485  {
3486  switch (c)
3487  {
3488  case 'U':
3489  conn->username = strdup(pgis_optarg);
3490  break;
3491  case 'p':
3492  conn->port = strdup(pgis_optarg);
3493  break;
3494  case 'W':
3495  conn->password = strdup(pgis_optarg);
3496  break;
3497  case 'd':
3498  conn->database = strdup(pgis_optarg);
3499  break;
3500  case 'h':
3501  conn->host = strdup(pgis_optarg);
3502  break;
3503  default:
3504  usage();
3505  free(conn);
3507  exit(0);
3508  }
3509  }
3510 
3511  /* initialize the GTK stack */
3512  gtk_init(&argc, &argv);
3513 
3514  /* set up the user interface */
3524 
3525  /* start the main loop */
3526  gtk_main();
3527 
3528  /* Free the configuration */
3529  free(conn);
3531 
3532  return 0;
3533 }
static void pgui_create_tablechooser_dialog()
static void pgui_create_about_dialog(void)
static void pgui_create_progress_dialog()
static SHPLOADERCONFIG * global_loader_config
void set_dumper_config_defaults(SHPDUMPERCONFIG *config)
static SHPCONNECTIONCONFIG * conn
static void usage()
void set_loader_config_defaults(SHPLOADERCONFIG *config)
#define GEOMETRY_DEFAULT
static void pgui_create_loader_options_dialog()
static SHPDUMPERCONFIG * global_dumper_config
static void pgui_create_main_window(const SHPCONNECTIONCONFIG *conn)
static void pgui_create_folderchooser_dialog(void)
static void pgui_create_dumper_options_dialog()
static void pgui_create_filechooser_dialog(void)
static void pgui_create_connection_window()
void free(void *)
void * malloc(YYSIZE_T)
char * pgis_optarg
Definition: getopt.c:41
int pgis_getopt(int argc, char **argv, char *opts)
Definition: getopt.c:44

Here is the call graph for this function: