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

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

References shp_loader_config::createindex, shp_connection_state::database, shp_loader_config::dump_format, shp_loader_config::geo_col, GEOMETRY_DEFAULT, shp_connection_state::host, 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.

3451 {
3452  int c;
3453 
3454 #ifdef ENABLE_NLS
3455  setlocale (LC_ALL, "");
3456  bindtextdomain (PACKAGE, PGSQL_LOCALEDIR);
3457  textdomain (PACKAGE);
3458 #endif
3459 
3460  /* Parse command line options and set configuration */
3461  global_loader_config = malloc(sizeof(SHPLOADERCONFIG));
3463  global_dumper_config = malloc(sizeof(SHPDUMPERCONFIG));
3465 
3466  /* Here we override any defaults for the GUI */
3470 
3471  conn = malloc(sizeof(SHPCONNECTIONCONFIG));
3472  memset(conn, 0, sizeof(SHPCONNECTIONCONFIG));
3473 
3474  /* Here we override any defaults for the connection */
3475  conn->host = strdup("localhost");
3476  conn->port = strdup("5432");
3477 
3478  while ((c = pgis_getopt(argc, argv, "U:p:W:d:h:")) != -1)
3479  {
3480  switch (c)
3481  {
3482  case 'U':
3483  conn->username = strdup(pgis_optarg);
3484  break;
3485  case 'p':
3486  conn->port = strdup(pgis_optarg);
3487  break;
3488  case 'W':
3489  conn->password = strdup(pgis_optarg);
3490  break;
3491  case 'd':
3492  conn->database = strdup(pgis_optarg);
3493  break;
3494  case 'h':
3495  conn->host = strdup(pgis_optarg);
3496  break;
3497  default:
3498  usage();
3499  free(conn);
3500  free(global_loader_config);
3501  exit(0);
3502  }
3503  }
3504 
3505  /* initialize the GTK stack */
3506  gtk_init(&argc, &argv);
3507 
3508  /* set up the user interface */
3518 
3519  /* start the main loop */
3520  gtk_main();
3521 
3522  /* Free the configuration */
3523  free(conn);
3524  free(global_loader_config);
3525 
3526  return 0;
3527 }
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()
char * pgis_optarg
Definition: getopt.c:45
int pgis_getopt(int argc, char **argv, char *opts)
Definition: getopt.c:48

Here is the call graph for this function: