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

◆ main()

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

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

3489{
3490 int c;
3491
3492#ifdef ENABLE_NLS
3493 setlocale (LC_ALL, "");
3494 bindtextdomain (PACKAGE, PGSQL_LOCALEDIR);
3495 textdomain (PACKAGE);
3496#endif
3497
3498 /* Parse command line options and set configuration */
3503
3504 /* Here we override any defaults for the GUI */
3508
3509 conn = malloc(sizeof(SHPCONNECTIONCONFIG));
3510 memset(conn, 0, sizeof(SHPCONNECTIONCONFIG));
3511
3512 /* Here we override any defaults for the connection */
3513 conn->host = strdup("localhost");
3514 conn->port = strdup("5432");
3515
3516 while ((c = pgis_getopt(argc, argv, "U:p:W:d:h:")) != -1)
3517 {
3518 switch (c)
3519 {
3520 case 'U':
3521 conn->username = strdup(pgis_optarg);
3522 break;
3523 case 'p':
3524 conn->port = strdup(pgis_optarg);
3525 break;
3526 case 'W':
3527 conn->password = strdup(pgis_optarg);
3528 break;
3529 case 'd':
3530 conn->database = strdup(pgis_optarg);
3531 break;
3532 case 'h':
3533 conn->host = strdup(pgis_optarg);
3534 break;
3535 default:
3536 usage();
3537 free(conn);
3539 exit(0);
3540 }
3541 }
3542
3543 /* initialize the GTK stack */
3544 gtk_init(&argc, &argv);
3545
3546 /* set up the user interface */
3556
3557 /* start the main loop */
3558 gtk_main();
3559
3560 /* Free the configuration */
3561 free(conn);
3563
3564 return 0;
3565}
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_progress_dialog(void)
static void pgui_create_loader_options_dialog()
static void pgui_create_folderchooser_dialog(void)
static void usage()
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: