]> granicus.if.org Git - graphviz/commitdiff
load dependent plugins first
authorellson <devnull@localhost>
Thu, 30 Aug 2007 19:18:41 +0000 (19:18 +0000)
committerellson <devnull@localhost>
Thu, 30 Aug 2007 19:18:41 +0000 (19:18 +0000)
lib/gvc/gvconfig.c
lib/gvc/gvplugin.c

index 59da502959588c3ea75b3c2d8d0af0785eb8b074..2547bb225930852738c1e2837c1f832a37008344 100644 (file)
@@ -243,7 +243,7 @@ static void gvconfig_plugin_install_builtins(GVC_t * gvc)
 }
 
 #ifdef ENABLE_LTDL
-static void gvconfig_write_library_config(char *path, gvplugin_library_t *library, FILE *f)
+static void gvconfig_write_library_config(GVC_t *gvc, char *path, gvplugin_library_t *library, FILE *f)
 {
     gvplugin_api_t *apis;
     gvplugin_installed_t *types;
@@ -253,6 +253,14 @@ static void gvconfig_write_library_config(char *path, gvplugin_library_t *librar
     for (apis = library->apis; (types = apis->types); apis++) {
         fprintf(f, "\t%s {\n", gvplugin_api_name(apis->api));
        for (i = 0; types[i].type; i++) {
+#if 0
+/* this was a good idea, but fails because we need a config to load
+ * by plugin name, and were still generating the config.
+ */
+           /* verify that dependencies are available */
+            if (! (gvplugin_load(gvc, apis->api, types[i].type)))
+               fprintf(f, "#FAILS");
+#endif
            fprintf(f, "\t\t%s %d\n", types[i].type, types[i].quality);
        }
        fputs ("\t}\n", f);
@@ -408,9 +416,8 @@ static void config_rescan(GVC_t *gvc, char *config_path)
                    path = strrchr(globbuf.gl_pathv[i],'/');
                    if (path)
                        path++;
-                   if (f && path) {
-                       gvconfig_write_library_config(path, library, f);
-                   }
+                   if (f && path)
+                       gvconfig_write_library_config(gvc, path, library, f);
                }
            }
        }
index 76817e27b26eed6368ac06352d0c57372358a6d4..1aaabcd89d8b1dcf2010eed221c628a37321536f 100644 (file)
@@ -277,8 +277,12 @@ gvplugin_available_t *gvplugin_load(GVC_t * gvc, api_t api, char *str)
        if (strcmp(reqpkg, (*pnext)->packagename) == 0)
            break;  /* found with required matching packagname */
     }
-
     rv = *pnext;
+
+    if (dep && (apidep != api)) /* load dependency if needed */
+       if (! (gvplugin_load(gvc, apidep, dep)))
+           rv = NULL;
+
     if (rv && rv->typeptr == NULL) {
        library = gvplugin_library_load(gvc, rv->path);
        if (library) {
@@ -302,10 +306,6 @@ gvplugin_available_t *gvplugin_load(GVC_t * gvc, api_t api, char *str)
         }
     }
 
-    if (dep && (apidep != api)) /* load dependency if needed */
-       if (! (gvplugin_load(gvc, apidep, dep)))
-           rv = NULL;
-
     /* one last check for successfull load */
     if (rv && rv->typeptr == NULL)
        rv = NULL;