diff options
| author | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2022-11-16 19:06:04 +0200 |
|---|---|---|
| committer | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2022-11-17 11:00:06 +0200 |
| commit | fc899c09628a82b05e43249b033e55fc7edbd28e (patch) | |
| tree | 8536055d851c37c2266d0d03893ddc8a4c187326 /guile | |
| parent | 64f08149bce7f27bef35762b95fb8304b0300e8c (diff) | |
guile: update for removing runtime
Diffstat (limited to 'guile')
| -rw-r--r-- | guile/mu-guile-message.cc | 1 | ||||
| -rw-r--r-- | guile/mu-guile.cc | 19 |
2 files changed, 7 insertions, 13 deletions
diff --git a/guile/mu-guile-message.cc b/guile/mu-guile-message.cc index 184bd91..cab66bb 100644 --- a/guile/mu-guile-message.cc +++ b/guile/mu-guile-message.cc @@ -32,7 +32,6 @@ #include "mu-guile.hh" -#include <mu-runtime.hh> #include <mu-store.hh> #include <mu-query.hh> diff --git a/guile/mu-guile.cc b/guile/mu-guile.cc index ff62273..853b123 100644 --- a/guile/mu-guile.cc +++ b/guile/mu-guile.cc @@ -1,5 +1,5 @@ /* -** Copyright (C) 2011-2021 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> +** Copyright (C) 2011-2022 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -23,13 +23,11 @@ #include <locale.h> #include <glib-object.h> - #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wredundant-decls" #include <libguile.h> #pragma GCC diagnostic pop -#include <mu-runtime.hh> #include <mu-store.hh> #include <mu-query.hh> @@ -75,16 +73,14 @@ mu_guile_g_error(const char* func_name, GError* err) static Option<Mu::Store> StoreSingleton = Nothing; static bool -mu_guile_init_instance(const char* muhome) -try { +mu_guile_init_instance(const std::string& muhome) try { setlocale(LC_ALL, ""); - if (!mu_runtime_init(muhome, "guile", true) || StoreSingleton) - return FALSE; - const auto path{mu_runtime_path(MU_RUNTIME_PATH_XAPIANDB)}; + const auto path{runtime_path(RuntimePath::XapianDb, muhome)}; auto store = Store::make(path); if (!store) { - g_critical("error creating store @ %s: %s", path, store.error().what()); + g_critical("error creating store @ %s: %s", path.c_str(), + store.error().what()); throw store.error(); } else StoreSingleton.emplace(std::move(store.value())); @@ -114,8 +110,6 @@ static void mu_guile_uninit_instance() { StoreSingleton.reset(); - - mu_runtime_uninit(); } Mu::Store& @@ -162,9 +156,10 @@ SCM_DEFINE_PUBLIC(mu_initialize, else muhome = scm_to_utf8_string(MUHOME); - if (!mu_guile_init_instance(muhome)) { + if (!mu_guile_init_instance(muhome ? muhome : "")) { free(muhome); mu_guile_error(FUNC_NAME, 0, "Failed to initialize mu", SCM_UNSPECIFIED); + return SCM_UNSPECIFIED; } g_debug("mu-guile: initialized @ %s", muhome ? muhome : "<default>"); |
