]> granicus.if.org Git - graphviz/commitdiff
- report plugin library loads with -v2
authorellson <devnull@localhost>
Sat, 17 Jun 2006 16:21:43 +0000 (16:21 +0000)
committerellson <devnull@localhost>
Sat, 17 Jun 2006 16:21:43 +0000 (16:21 +0000)
lib/common/args.c
lib/common/globals.h
lib/common/input.c
lib/gvc/dot_builtins.c
lib/gvc/gvcommon.h
lib/gvc/gvconfig.c
lib/gvc/gvcproc.h
lib/gvc/gvplugin.c

index 88572e7bf80903db39df0e137fd65c57b84e74a4..3244818515a241c3af076776fd5cb050bebb062a 100644 (file)
@@ -23,6 +23,7 @@
  * Needs to be fixed before layout engines can be plugins.
  */
 
+#include <ctype.h>
 #include "render.h"
 #include "tlayout.h"
 
@@ -51,7 +52,7 @@ neato_extra_args(GVC_t *gvc, int argc, char** argv)
     arg = argv[i];
     if (arg && *arg == '-') {
       switch (arg[1]) {
-      case 'x' : Reduce = TRUE; break;
+      case 'x' : Reduce = true; break;
       case 'n':
         if (arg[2]) {
           Nop = atoi(arg+2);
@@ -91,7 +92,7 @@ memtest_extra_args(GVC_t *gvc, int argc, char** argv)
     arg = argv[i];
     if (arg && *arg == '-') {
       switch (arg[1]) {
-      case 'm' : MemTest = TRUE; break;
+      case 'm' : MemTest = true; break;
       default :
         cnt++;
         if (*p != arg) *p = arg;
@@ -121,7 +122,13 @@ config_extra_args(GVC_t *gvc, int argc, char** argv)
     arg = argv[i];
     if (arg && *arg == '-') {
       switch (arg[1]) {
-      case 'c' : Config = TRUE; break;
+      case 'v':
+       gvc->common.verbose = 1;
+       if (isdigit(arg[2]))
+         gvc->common.verbose = atoi(&arg[2]);
+        break;
+      case 'c' :
+          gvc->common.config = true; break;
       default :
         cnt++;
         if (*p != arg) *p = arg;
index 200555b95a92c622a94799025a11a9e04a8e71ad..3a6cbfbd5a026191e438fd31d7227103c59faebf 100644 (file)
@@ -65,7 +65,7 @@ extern "C" {
 #endif
 
     EXTERN unsigned char Verbose;
-    EXTERN bool Reduce, MemTest, Config;
+    EXTERN bool Reduce, MemTest;
     EXTERN char *HTTPServerEnVar;
     EXTERN char *Output_file_name;
     EXTERN int graphviz_errors;
index 1bdbb0ad7a25f39c1d7ac78df6075827b604a52b..d1f29ab6035236135edc11d7dd4f2097e6e84d33 100644 (file)
@@ -61,10 +61,11 @@ static char *memtestFlags = "(additional options for memtest)  [-m]\n";
 static char *memtestItems = "\n\
  -m          - Memory test (Observe no growth with top. Kill when done.)\n";
 
-static char *configFlags = "(additional options for config)  [-c]\n";
+static char *configFlags = "(additional options for config)  [-cv]\n";
 static char *configItems = "\n\
  -c          - Configure plugins (Writes $prefix/lib/graphviz/config \n\
-               with available plugin information.  Needs write priviledge.)\n";
+               with available plugin information.  Needs write priviledge.)\n\
+ -v          - Enable verbose mode \n";
 
 void dotneato_usage(int exval)
 {
@@ -170,15 +171,19 @@ void dotneato_args_initialize(GVC_t * gvc, int argc, char **argv)
     Gvfilepath = getenv("GV_FILE_PATH");
 
     /* configure for available plugins and codegens */
-    gvconfig(gvc, Config);
-    if (Config)
+    gvconfig(gvc, gvc->common.config);
+    if (gvc->common.config)
        exit (0);
 
-    CmdName = gvc->common.cmdname = dotneato_basename(argv[0]);
+    gvc->common.cmdname = dotneato_basename(argv[0]);
     i = gvlayout_select(gvc, gvc->common.cmdname);
     if (i == NO_SUPPORT)
        gvlayout_select(gvc, "dot");
 
+    /* feed the globals */
+    Verbose = gvc->common.verbose;
+    CmdName = gvc->common.cmdname;
+
     aginit();
     nfiles = 0;
     for (i = 1; i < argc; i++)
@@ -286,10 +291,12 @@ void dotneato_args_initialize(GVC_t * gvc, int argc, char **argv)
                    PSinputscale = POINTS_PER_INCH;
                break;
            case 'v':
-               gvc->common.verbose = 1;
+/* already processed in args.c:config_extra_args() */
+#if 0
+               Verbose = 1;
                if (isdigit(*(unsigned char *) rest))
-                   gvc->common.verbose = atoi(rest);
-               Verbose = gvc->common.verbose;
+                   Verbose = atoi(rest);
+#endif
                break;
            case 'x':
                Reduce = TRUE;
index 23af745acd4aff7d563ca498e02fdf6f8059d2fe..b139caa3ae39eab9a275ccc77a3d2428b2e5fb94 100644 (file)
@@ -30,7 +30,6 @@ const lt_symlist_t lt_preloaded_symbols[] = {
        { "gvplugin_dot_layout_LTX_library", (void*)(&gvplugin_dot_layout_LTX_library) },
        { "gvplugin_neato_layout_LTX_library", (void*)(&gvplugin_neato_layout_LTX_library) },
        { "gvplugin_pango_LTX_library", (void*)(&gvplugin_gd_LTX_library) },
-       { "gvplugin_gd_LTX_library", (void*)(&gvplugin_gd_LTX_library) },
        { "gvplugin_core_LTX_library", (void*)(&gvplugin_core_LTX_library) },
        { 0, 0 }
 };
index d4640d496245a37d9835560233af58ba5da9c2e4..0646dbcd9b1c6efd33ecc4cc3564272e08b30a79 100644 (file)
@@ -26,6 +26,7 @@ extern "C" {
        char **info;
        char *cmdname;
        int verbose;
+       bool config;
         void (*errorfn) (char *fmt, ...);
        char **show_boxes; /* emit code for correct box coordinates */
        char **lib; 
index e3b79ae64e16036a0a93042e6dac4ff8e06cd7aa..6eb82f4d1c72d56f7704bdc8c2bee8489f5e0028 100644 (file)
@@ -336,7 +336,7 @@ static void config_rescan(GVC_t *gvc, char *config_path)
        for (i = 0; i < globbuf.gl_pathc; i++) {
            re_status = regexec(&re, globbuf.gl_pathv[i], (size_t) 0, NULL, 0);
            if (re_status == 0) {
-               library = gvplugin_library_load(globbuf.gl_pathv[i]);
+               library = gvplugin_library_load(gvc, globbuf.gl_pathv[i]);
                if (library) {
                    gvconfig_plugin_install_from_library(gvc, globbuf.gl_pathv[i], library);
                    path = strrchr(globbuf.gl_pathv[i],'/');
index d507bb10ff3569a55252fd37d6a30b42d56d4242..b7e48c6f57063deaa9bdfa40bbffc0ec0fb290e8 100644 (file)
@@ -37,7 +37,7 @@ extern "C" {
                    char *typestr, int quality, char *packagename, char *path,
                    gvplugin_installed_t * typeptr);
     extern gvplugin_available_t *gvplugin_load(GVC_t * gvc, api_t api, char *type);
-    extern gvplugin_library_t *gvplugin_library_load(char *path);
+    extern gvplugin_library_t *gvplugin_library_load(GVC_t *gvc, char *path);
     extern const char *gvplugin_list(GVC_t * gvc, api_t api, char *str);
     extern api_t gvplugin_api(char *str);
     extern char * gvplugin_api_name(api_t api);
index ff53123811a727f002e57f0d47594bbc3b7650f9..df0c641367e5e919f627887f5fa64fa63d177fd4 100644 (file)
@@ -98,7 +98,7 @@ bool gvplugin_install(GVC_t * gvc, api_t api,
     return TRUE;
 }
 
-gvplugin_library_t *gvplugin_library_load(char *path)
+gvplugin_library_t *gvplugin_library_load(GVC_t *gvc, char *path)
 {
 #ifdef ENABLE_LTDL
     lt_dlhandle hndl;
@@ -140,6 +140,8 @@ gvplugin_library_t *gvplugin_library_load(char *path)
         agerr(AGWARN, (char*)lt_dlerror());
         return NULL;
     }
+    if (gvc->common.verbose >= 2)
+       fprintf(stderr, "Loading %s\n", p);
 
     s = strrchr(p, '/');
     len = strlen(s); 
@@ -211,7 +213,7 @@ gvplugin_available_t *gvplugin_load(GVC_t * gvc, api_t api, char *str)
     rv = *pnext;
     if ((*pnext) && (*pnext)->typeptr == NULL) {
         rv = NULL;
-       library = gvplugin_library_load((*pnext)->path);
+       library = gvplugin_library_load(gvc, (*pnext)->path);
        if (library) {
 
            /*