PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ main()

int main ( int  argc,
char *  argv[] 
)

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

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

References conn, shp_loader_config::createindex, shp_connection_state::database, shp_loader_config::dump_format, free(), shp_loader_config::geo_col, GEOMETRY_DEFAULT, global_dumper_config, global_loader_config, 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.

Here is the call graph for this function: