#include "giomodule.h"
#include "giomodule-priv.h"
+#include "gmemorysettingsbackend.h"
#include "glocalfilemonitor.h"
#include "glocaldirectorymonitor.h"
#include "gnativevolumemonitor.h"
* it uses the implementations that have been associated with it.
* Depending on the use case, it may use all implementations, or
* only the one with the highest priority, or pick a specific
- * one by name.
+ * one by name.
+ *
+ * To avoid opening all modules just to find out what extension
+ * points they implement, GIO makes use of a caching mechanism,
+ * see <link linkend="gio-querymodules">gio-querymodules</link>.
+ * You are expected to run this command after installing a
+ * GIO module.
*/
struct _GIOModule {
GTypeModule parent_instance;
const gchar *name;
char *filename;
GDir *dir;
- struct stat statbuf;
+ GStatBuf statbuf;
char *data;
time_t cache_mtime;
GHashTable *cache;
continue; /* Invalid line, ignore */
*colon = 0; /* terminate filename */
- file = strdup (line);
+ file = g_strdup (line);
colon++; /* after colon */
while (g_ascii_isspace (*colon))
colon++;
extension_points = g_strsplit (colon, ",", -1);
- g_hash_table_insert (cache, g_strdup (file), extension_points);
+ g_hash_table_insert (cache, file, extension_points);
}
g_strfreev (lines);
}
g_dir_close (dir);
g_hash_table_destroy (cache);
+
+ g_free (filename);
}
}
/* Initialize types from built-in "modules" */
+ g_memory_settings_backend_get_type ();
#if defined(HAVE_SYS_INOTIFY_H) || defined(HAVE_LINUX_INOTIFY_H)
_g_inotify_directory_monitor_get_type ();
_g_inotify_file_monitor_get_type ();