summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6251e2b)
This is slightly more tidy, but more importantly it allows for re-use
of this code in n_d_create_with_config. That re-use will be crucial
when we no longer call n_d_open_with_config from
n_d_create_with_config.
_notmuch_config_cache (notmuch, NOTMUCH_CONFIG_DATABASE_PATH, path);
}
_notmuch_config_cache (notmuch, NOTMUCH_CONFIG_DATABASE_PATH, path);
}
+static void
+_init_libs ()
+{
+
+ static int initialized = 0;
+
+ /* Initialize the GLib type system and threads */
+#if ! GLIB_CHECK_VERSION (2, 35, 1)
+ g_type_init ();
+#endif
+
+ /* Initialize gmime */
+ if (! initialized) {
+ g_mime_init ();
+ initialized = 1;
+ }
+}
+
notmuch_status_t
notmuch_database_open_with_config (const char *database_path,
notmuch_database_mode_t mode,
notmuch_status_t
notmuch_database_open_with_config (const char *database_path,
notmuch_database_mode_t mode,
int err;
unsigned int version;
GKeyFile *key_file = NULL;
int err;
unsigned int version;
GKeyFile *key_file = NULL;
- static int initialized = 0;
notmuch = _alloc_notmuch ();
if (! notmuch) {
notmuch = _alloc_notmuch ();
if (! notmuch) {
- /* Initialize the GLib type system and threads */
-#if ! GLIB_CHECK_VERSION (2, 35, 1)
- g_type_init ();
-#endif
-
- /* Initialize gmime */
- if (! initialized) {
- g_mime_init ();
- initialized = 1;
- }
-
try {
std::string last_thread_id;
std::string last_mod;
try {
std::string last_thread_id;
std::string last_mod;
int err;
void *local = talloc_new (NULL);
int err;
void *local = talloc_new (NULL);
if ((status = _choose_database_path (local, config_path, profile,
&key_file, &database_path, &message)))
goto DONE;
if ((status = _choose_database_path (local, config_path, profile,
&key_file, &database_path, &message)))
goto DONE;