PostGIS 3.6.2dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ main()

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

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

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