- struct casefile_factory *factory;
- PsppireDict *dictionary = 0;
-
- gchar *filename=0;
- GError *err = 0;
- gchar *vers;
-
- set_program_name (argv[0]);
-
- if ( ! gtk_parse_args (&argc, &argv) )
- {
- perror ("Error parsing arguments");
- exit (1);
- }
-
- if ( (vers = gtk_check_version (GTK_MAJOR_VERSION,
- GTK_MINOR_VERSION,
- GTK_MICRO_VERSION)) )
- {
- g_critical (vers);
- }
-
-
- /* gtk_init messes with the locale.
- So unset the bits we want to control ourselves */
- setlocale (LC_NUMERIC, "C");
-
- bindtextdomain (PACKAGE, locale_dir);
-
- textdomain (PACKAGE);
-
- if ( ! parse_command_line (&argc, &argv, &filename, &err) )
- {
- g_clear_error (&err);
- return 0;
- }
-
- glade_init ();
-
- fmt_init ();
- settings_init ();
- fh_init ();
- factory = flexifile_factory_create ();
- the_source_stream = create_source_stream (
- fn_getenv_default ("STAT_INCLUDE_PATH", include_path)
- );
-
- the_dataset = create_dataset (factory,
- replace_flexifile,
- replace_dictionary);
-
- message_dialog_init (the_source_stream);
-
- dictionary = psppire_dict_new_from_dict (
- dataset_dict (the_dataset)
- );
-
- bind_textdomain_codeset (PACKAGE, "UTF-8");
-
- gdk_init (&argc, &argv);
-
- /* Create the model for the var_sheet */
- the_var_store = psppire_var_store_new (dictionary);
-
-
- the_data_store = psppire_data_store_new (dictionary);
-
- proc_set_source (the_dataset,
- storage_source_create (the_data_store->case_file->flexifile)
- );
-
- create_icon_factory ();
-
- new_data_window (NULL, NULL);
-
- /* start the event loop */
- gtk_main ();
-
- destroy_source_stream (the_source_stream);
- message_dialog_done ();
-