int
main (int argc, char** argv)
{
    qof_log_init ();
    fflush (stdout);
    test_string_converters ();
    test_bad_string ();
    fflush (stdout);
    print_test_results ();
    exit (get_rv ());
}
Example #2
0
void
qof_init (void)
{
#ifndef HAVE_GLIB_2_36
    g_type_init(); /* Automatic as of GLib 2.36 */
#endif
    qof_log_init();
    qof_string_cache_init();
    qof_object_initialize ();
    qof_query_init ();
    qof_book_register ();
}
Example #3
0
int main()
{
    qof_log_init();
    qof_init();
    gnc_module_system_init();
    char * no_args[1] = { NULL };
    gnc_engine_init(0, no_args);

    QofSession * s = qof_session_new();
    qof_session_begin(s, "sqlite3:///tmp/blah.gnucash", 0, 1, 0);
    qof_session_load(s, NULL);
    qof_session_save(s, NULL);
    qof_session_end(s);
    return 0;
}
Example #4
0
int main()
{
    const char* testurl = "sqlite3://" TESTFILE;
    qof_log_init();
    qof_init();
    gnc_module_system_init();
    char * no_args[1] = { NULL };
    gnc_engine_init(0, no_args);

    QofSession * s = qof_session_new();
    qof_session_begin(s, testurl, 0, 1, 0);
    qof_session_load(s, NULL);
    qof_session_save(s, NULL);
    qof_session_end(s);
    unlink(TESTFILE);
    return 0;
}
Example #5
0
int
main(int argc, char ** argv)
{
#if !defined(G_THREADS_ENABLED) || defined(G_THREADS_IMPL_NONE)
#    error "No GLib thread implementation available!"
#endif
    g_thread_init(NULL);

#ifdef ENABLE_BINRELOC
    {
        GError *binreloc_error = NULL;
        if (!gnc_gbr_init(&binreloc_error))
        {
            g_print("main: Error on gnc_gbr_init: %s\n", binreloc_error->message);
            g_error_free(binreloc_error);
        }
    }
#else
    g_message("main: binreloc relocation support was disabled at configure time.\n");
#endif

    /* This should be called before gettext is initialized
     * The user may have configured a different language via
     * the environment file.
     */
    environment_override();

    #ifdef HAVE_GETTEXT
    {
        gchar *localedir = gnc_path_get_localedir();
        /* setlocale(LC_ALL, ""); is already called by gtk_set_locale()
           via gtk_init(). */
        bindtextdomain(GETTEXT_PACKAGE, localedir);
        textdomain(GETTEXT_PACKAGE);
        bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
        g_free(localedir);
    }
#endif

    qof_log_init();
    qof_log_set_default(QOF_LOG_INFO);

    gnucash_command_line(&argc, argv);
    gnc_print_unstable_message();
    gnc_log_init();

    gnc_module_system_init();

    if (add_quotes_file)
    {
        gchar *prefix = gnc_path_get_prefix ();
        gchar *pkgsysconfdir = gnc_path_get_pkgsysconfdir ();
        gchar *pkgdatadir = gnc_path_get_pkgdatadir ();
        gchar *pkglibdir = gnc_path_get_pkglibdir ();
        /* This option needs to run without a display, so we can't
           initialize any GUI libraries.  */
        gnome_program_init(
            "gnucash", VERSION, LIBGNOME_MODULE,
            argc, argv,
            GNOME_PARAM_APP_PREFIX, prefix,
            GNOME_PARAM_APP_SYSCONFDIR, pkgsysconfdir,
            GNOME_PARAM_APP_DATADIR, pkgdatadir,
            GNOME_PARAM_APP_LIBDIR, pkglibdir,
            GNOME_PARAM_NONE);
        g_free (prefix);
        g_free (pkgsysconfdir);
        g_free (pkgdatadir);
        g_free (pkglibdir);
        scm_boot_guile(argc, argv, inner_main_add_price_quotes, 0);
        exit(0);  /* never reached */
    }

    gnc_gnome_init (argc, argv, VERSION);
    gnc_gui_init();
    scm_boot_guile(argc, argv, inner_main, 0);
    exit(0); /* never reached */
}