[groonga-commit:1276] ranguba/chupatext [master] * chupatext/chupa_module.c (chupa_module_find): match by stem name of modules.

null+ranguba at clear-code.com null+ranguba at clear-code.com
Tue Sep 14 03:25:19 EDT 2010


Nobuyoshi Nakada	2010-09-14 07:25:19 +0000 (Tue, 14 Sep 2010)

  New Revision: e7145c440e00c24c22146e7fb897226fdcf77b10

  Log:
    * chupatext/chupa_module.c (chupa_module_find): match by stem name of   modules.

  Modified files:
    chupatext/chupa_module.c

  Modified: chupatext/chupa_module.c (+2 -23)
===================================================================
--- chupatext/chupa_module.c    2010-09-14 01:25:59 +0000 (39ffc29)
+++ chupatext/chupa_module.c    2010-09-14 07:25:19 +0000 (f906e05)
@@ -231,12 +231,8 @@ chupa_module_find(GList *modules, const gchar *name)
     GList *node;
 
     for (node = modules; node; node = g_list_next(node)) {
-        ChupaModule *module = node->data;
-        ChupaModulePrivate *priv;
-
-        priv = CHUPA_MODULE_GET_PRIVATE(module);
-        if (_chupa_module_match_name(priv->mod_path, name))
-            return module;
+        if (strcmp(G_TYPE_MODULE(node->data)->name, name) == 0)
+            return node->data;
     }
 
     return NULL;
@@ -411,23 +407,6 @@ chupa_module_load_modules_unique(const gchar *base_dir,
     return g_list_concat(modules, exist_modules);
 }
 
-static gboolean
-_chupa_module_match_name(const gchar *mod_path, const gchar *name)
-{
-    gboolean matched;
-    gchar *module_base_name, *normalized_matched_name;
-
-    module_base_name = g_path_get_basename(mod_path);
-    normalized_matched_name = g_strconcat(name, "." G_MODULE_SUFFIX, NULL);
-
-    matched = (0 == strcmp(module_base_name, normalized_matched_name));
-
-    g_free(module_base_name);
-    g_free(normalized_matched_name);
-
-    return matched;
-}
-
 void
 chupa_module_unload(ChupaModule *module)
 {



More information about the groonga-commit mailing list