PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ main()

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

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

3462 {
3463  int c;
3464 
3465 #ifdef ENABLE_NLS
3466  setlocale (LC_ALL, "");
3467  bindtextdomain (PACKAGE, PGSQL_LOCALEDIR);
3468  textdomain (PACKAGE);
3469 #endif
3470 
3471  /* Parse command line options and set configuration */
3476 
3477  /* Here we override any defaults for the GUI */
3481 
3482  conn = malloc(sizeof(SHPCONNECTIONCONFIG));
3483  memset(conn, 0, sizeof(SHPCONNECTIONCONFIG));
3484 
3485  /* Here we override any defaults for the connection */
3486  conn->host = strdup("localhost");
3487  conn->port = strdup("5432");
3488 
3489  while ((c = pgis_getopt(argc, argv, "U:p:W:d:h:")) != -1)
3490  {
3491  switch (c)
3492  {
3493  case 'U':
3494  conn->username = strdup(pgis_optarg);
3495  break;
3496  case 'p':
3497  conn->port = strdup(pgis_optarg);
3498  break;
3499  case 'W':
3500  conn->password = strdup(pgis_optarg);
3501  break;
3502  case 'd':
3503  conn->database = strdup(pgis_optarg);
3504  break;
3505  case 'h':
3506  conn->host = strdup(pgis_optarg);
3507  break;
3508  default:
3509  usage();
3510  free(conn);
3512  exit(0);
3513  }
3514  }
3515 
3516  /* initialize the GTK stack */
3517  gtk_init(&argc, &argv);
3518 
3519  /* set up the user interface */
3529 
3530  /* start the main loop */
3531  gtk_main();
3532 
3533  /* Free the configuration */
3534  free(conn);
3536 
3537  return 0;
3538 }
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: