From: ellson Date: Sat, 17 Jun 2006 16:21:43 +0000 (+0000) Subject: - report plugin library loads with -v2 X-Git-Tag: LAST_LIBGRAPH~32^2~6424 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba50e09ae27133b430d94b5f5bf1c13723d586e7;p=graphviz - report plugin library loads with -v2 --- diff --git a/lib/common/args.c b/lib/common/args.c index 88572e7bf..324481851 100644 --- a/lib/common/args.c +++ b/lib/common/args.c @@ -23,6 +23,7 @@ * Needs to be fixed before layout engines can be plugins. */ +#include #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; diff --git a/lib/common/globals.h b/lib/common/globals.h index 200555b95..3a6cbfbd5 100644 --- a/lib/common/globals.h +++ b/lib/common/globals.h @@ -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; diff --git a/lib/common/input.c b/lib/common/input.c index 1bdbb0ad7..d1f29ab60 100644 --- a/lib/common/input.c +++ b/lib/common/input.c @@ -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; diff --git a/lib/gvc/dot_builtins.c b/lib/gvc/dot_builtins.c index 23af745ac..b139caa3a 100644 --- a/lib/gvc/dot_builtins.c +++ b/lib/gvc/dot_builtins.c @@ -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 } }; diff --git a/lib/gvc/gvcommon.h b/lib/gvc/gvcommon.h index d4640d496..0646dbcd9 100644 --- a/lib/gvc/gvcommon.h +++ b/lib/gvc/gvcommon.h @@ -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; diff --git a/lib/gvc/gvconfig.c b/lib/gvc/gvconfig.c index e3b79ae64..6eb82f4d1 100644 --- a/lib/gvc/gvconfig.c +++ b/lib/gvc/gvconfig.c @@ -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],'/'); diff --git a/lib/gvc/gvcproc.h b/lib/gvc/gvcproc.h index d507bb10f..b7e48c6f5 100644 --- a/lib/gvc/gvcproc.h +++ b/lib/gvc/gvcproc.h @@ -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); diff --git a/lib/gvc/gvplugin.c b/lib/gvc/gvplugin.c index ff5312381..df0c64136 100644 --- a/lib/gvc/gvplugin.c +++ b/lib/gvc/gvplugin.c @@ -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) { /*