[gegl] gegl: remove dead code in moduledb
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] gegl: remove dead code in moduledb
- Date: Mon, 21 Feb 2022 21:39:32 +0000 (UTC)
commit d91b75b429edf98646390a98e9a79771579d00d5
Author: Øyvind Kolås <pippin gimp org>
Date: Mon Feb 21 22:38:43 2022 +0100
gegl: remove dead code in moduledb
gegl/module/geglmoduledb.c | 202 ---------------------------------------------
gegl/module/geglmoduledb.h | 6 --
2 files changed, 208 deletions(-)
---
diff --git a/gegl/module/geglmoduledb.c b/gegl/module/geglmoduledb.c
index 21507c748..700564a2e 100644
--- a/gegl/module/geglmoduledb.c
+++ b/gegl/module/geglmoduledb.c
@@ -48,28 +48,11 @@ enum
};
-/* #define DUMP_DB 1 */
-
-
static void gegl_module_db_finalize (GObject *object);
-static void gegl_module_db_module_initialize (const GeglDatafileData *file_data,
- gpointer user_data);
static void gegl_module_db_module_search (const GeglDatafileData *file_data,
gpointer user_data);
-static GeglModule * gegl_module_db_module_find_by_path (GeglModuleDB *db,
- const char *fullpath);
-
-#ifdef DUMP_DB
-static void gegl_module_db_dump_module (gpointer data,
- gpointer user_data);
-#endif
-
-static void gegl_module_db_module_on_disk_func (gpointer data,
- gpointer user_data);
-static void gegl_module_db_module_remove_func (gpointer data,
- gpointer user_data);
static void gegl_module_db_module_modified (GeglModule *module,
GeglModuleDB *db);
@@ -195,53 +178,6 @@ is_in_inhibit_list (const gchar *filename,
return FALSE;
}
-/**
- * gegl_module_db_set_load_inhibit:
- * @db: A #GeglModuleDB.
- * @load_inhibit: A #G_SEARCHPATH_SEPARATOR delimited list of module
- * filenames to exclude from auto-loading.
- *
- * Sets the @load_inhibit flag for all #GeglModule's which are kept
- * by @db (using gegl_module_set_load_inhibit()).
- **/
-void
-gegl_module_db_set_load_inhibit (GeglModuleDB *db,
- const gchar *load_inhibit)
-{
- GList *list;
-
- g_return_if_fail (GEGL_IS_MODULE_DB (db));
-
- g_free (db->load_inhibit);
- db->load_inhibit = g_strdup (load_inhibit);
-
- for (list = db->modules; list; list = g_list_next (list))
- {
- GeglModule *module = list->data;
-
- gegl_module_set_load_inhibit (module,
- is_in_inhibit_list (module->filename,
- load_inhibit));
- }
-}
-
-/**
- * gegl_module_db_get_load_inhibit:
- * @db: A #GeglModuleDB.
- *
- * Return the #G_SEARCHPATH_SEPARATOR selimited list of module filenames
- * which are excluded from auto-loading.
- *
- * Return value: the @db's @load_inhibit string.
- **/
-const gchar *
-gegl_module_db_get_load_inhibit (GeglModuleDB *db)
-{
- g_return_val_if_fail (GEGL_IS_MODULE_DB (db), NULL);
-
- return db->load_inhibit;
-}
-
#ifdef ARCH_SIMD
static gboolean
@@ -383,49 +319,6 @@ gegl_module_db_load (GeglModuleDB *db,
}
}
-#ifdef DUMP_DB
- g_list_foreach (db->modules, gegl_module_db_dump_module, NULL);
-#endif
-}
-
-/**
- * gegl_module_db_refresh:
- * @db: A #GeglModuleDB.
- * @module_path: A #G_SEARCHPATH_SEPARATOR delimited list of directories
- * to load modules from.
- *
- * Does the same as gegl_module_db_load(), plus removes all #GeglModule
- * instances whose modules have been deleted from disk.
- *
- * Note that the #GeglModule's will just be removed from the internal
- * list and not freed as this is not possible with #GTypeModule
- * instances which actually implement types.
- **/
-void
-gegl_module_db_refresh (GeglModuleDB *db,
- const gchar *module_path)
-{
-#if 0
- GList *kill_list = NULL;
-
- g_return_if_fail (GEGL_IS_MODULE_DB (db));
- g_return_if_fail (module_path != NULL);
-
- /* remove modules we don't have on disk anymore */
- g_list_foreach (db->modules,
- gegl_module_db_module_on_disk_func,
- &kill_list);
- g_list_foreach (kill_list,
- gegl_module_db_module_remove_func,
- db);
- g_list_free (kill_list);
-
- /* walk filesystem and add new things we find */
- gegl_datafiles_read_directories (module_path,
- G_FILE_TEST_EXISTS,
- gegl_module_db_module_initialize,
- db);
-#endif
}
/* name must be of the form lib*.so (Unix) or *.dll (Win32) */
@@ -467,106 +360,11 @@ gegl_module_db_module_search (const GeglDatafileData *file_data,
gpointer user_data)
{
GeglModuleDB *db = GEGL_MODULE_DB (user_data);
- GeglModule *module;
- gboolean load_inhibit;
if (! valid_module_name (file_data->filename))
return;
db->to_load = g_list_prepend (db->to_load, g_strdup (file_data->filename));
-#if 0
- load_inhibit = is_in_inhibit_list (file_data->filename,
- db->load_inhibit);
- g_warning ("[%s]", file_data->filename);
-
- module = gegl_module_new (file_data->filename,
- load_inhibit,
- db->verbose);
-
- g_signal_connect (module, "modified",
- G_CALLBACK (gegl_module_db_module_modified),
- db);
-
- db->modules = g_list_append (db->modules, module);
- g_signal_emit (db, db_signals[ADD], 0, module);
-#endif
-}
-
-static GeglModule *
-gegl_module_db_module_find_by_path (GeglModuleDB *db,
- const char *fullpath)
-{
- GList *list;
-
- for (list = db->modules; list; list = g_list_next (list))
- {
- GeglModule *module = list->data;
-
- if (! strcmp (module->filename, fullpath))
- return module;
- }
-
- return NULL;
-}
-
-#ifdef DUMP_DB
-static void
-gegl_module_db_dump_module (gpointer data,
- gpointer user_data)
-{
- GeglModule *module = data;
-
- g_print ("\n%s: %s\n",
- module->filename,
- gegl_module_state_name (module->state));
-
- g_print (" module: %p lasterr: %s query: %p register: %p\n",
- module->module,
- module->last_module_error ? module->last_module_error : "NONE",
- module->query_module,
- module->register_module);
-}
-#endif
-
-static void
-gegl_module_db_module_on_disk_func (gpointer data,
- gpointer user_data)
-{
- GeglModule *module = data;
- GList **kill_list = user_data;
- gboolean old_on_disk;
-
- old_on_disk = module->on_disk;
-
- module->on_disk = g_file_test (module->filename, G_FILE_TEST_IS_REGULAR);
-
- /* if it's not on the disk, and it isn't in memory, mark it to be
- * removed later.
- */
- if (! module->on_disk && ! module->module)
- {
- *kill_list = g_list_append (*kill_list, module);
- module = NULL;
- }
-
- if (module && module->on_disk != old_on_disk)
- gegl_module_modified (module);
-}
-
-static void
-gegl_module_db_module_remove_func (gpointer data,
- gpointer user_data)
-{
- GeglModule *module = data;
- GeglModuleDB *db = user_data;
-
- g_signal_handlers_disconnect_by_func (module,
- gegl_module_db_module_modified,
- db);
-
- db->modules = g_list_remove (db->modules, module);
-
- g_signal_emit (db, db_signals[REMOVE], 0, module);
}
static void
diff --git a/gegl/module/geglmoduledb.h b/gegl/module/geglmoduledb.h
index dff25dd34..4edc95b02 100644
--- a/gegl/module/geglmoduledb.h
+++ b/gegl/module/geglmoduledb.h
@@ -65,14 +65,8 @@ struct _GeglModuleDBClass
GType gegl_module_db_get_type (void) G_GNUC_CONST;
GeglModuleDB * gegl_module_db_new (gboolean verbose);
-void gegl_module_db_set_load_inhibit (GeglModuleDB *db,
- const gchar *load_inhibit);
-const gchar * gegl_module_db_get_load_inhibit (GeglModuleDB *db);
-
void gegl_module_db_load (GeglModuleDB *db,
const gchar *module_path);
-void gegl_module_db_refresh (GeglModuleDB *db,
- const gchar *module_path);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]