From: ellson Date: Thu, 6 Jan 2005 04:04:20 +0000 (+0000) Subject: eliminate public func setCmdName X-Git-Tag: LAST_LIBGRAPH~32^2~8151 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ffaa9e517eb3a99c7cf96f7b8c3b06740bae99c;p=graphviz eliminate public func setCmdName don't reset Deffontname --- diff --git a/cmd/dot/dot.c b/cmd/dot/dot.c index 473b08fc6..f1dc477f7 100644 --- a/cmd/dot/dot.c +++ b/cmd/dot/dot.c @@ -23,7 +23,6 @@ #endif #include -#include #include #ifdef HAVE_UNISTD_H #include @@ -134,18 +133,8 @@ static graph_t *create_test_graph(void) int main(int argc, char **argv) { graph_t *g, *prev = NULL; - int rv; - char *str; gvc = gvNEWcontext(Info, username()); - - setCmdName(argv[0]); - - str = basename(argv[0]); - rv = gvlayout_select(gvc, str); - if (rv == NO_SUPPORT) - gvlayout_select(gvc, "dot"); - parse_args(gvc, argc, argv); #ifndef MSWIN32 diff --git a/lib/common/emit.c b/lib/common/emit.c index cc8d3c360..24811fa01 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -91,8 +91,6 @@ void emit_reset(GVC_t * gvc, graph_t * g) GP.x = GP.y = 0; CB.LL.x = CB.LL.y = CB.UR.x = CB.UR.y = 0; PFC.x = PFC.y = 0; - Deffontsize = 0; - Deffontname = (char *) 0; for (n = agfstnode(g); n; n = agnxtnode(g, n)) { ND_state(n) = 0; diff --git a/lib/common/input.c b/lib/common/input.c index f9381e363..453bdb2a2 100644 --- a/lib/common/input.c +++ b/lib/common/input.c @@ -14,9 +14,11 @@ * AT&T Research, Florham Park NJ * **********************************************************/ +#include +#include + #include "render.h" #include "htmltable.h" -#include #if !defined(DISABLE_CODEGENS) && !defined(HAVE_GD_FREETYPE) codegen_t *Output_codegen; @@ -94,16 +96,6 @@ void dotneato_usage(int exval) exit(exval); } -void setCmdName(char *s) -{ - char *n = strrchr(s, '/'); - - if (n) - CmdName = n + 1; - else - CmdName = s; -} - /* getFlagOpt: * Look for flag parameter. idx is index of current argument. * We assume argv[*idx] has the form "-x..." If there are characters @@ -145,6 +137,11 @@ void dotneato_initialize(GVC_t * gvc, int argc, char **argv) gvplugin_builtins(gvc); gvconfig(gvc, CONFIG); + CmdName = basename(argv[0]); + i = gvlayout_select(gvc, CmdName); + if (i == NO_SUPPORT) + gvlayout_select(gvc, "dot"); + aginit(); nfiles = 0; for (i = 1; i < argc; i++) @@ -152,8 +149,6 @@ void dotneato_initialize(GVC_t * gvc, int argc, char **argv) nfiles++; Files = N_NEW(nfiles + 1, char *); nfiles = 0; - if (!CmdName) - setCmdName(argv[0]); for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { rest = &(argv[i][2]); diff --git a/lib/common/output.c b/lib/common/output.c index 7eac4946f..c37773e5a 100644 --- a/lib/common/output.c +++ b/lib/common/output.c @@ -134,7 +134,7 @@ void dotneato_write_one(GVC_t * gvc, graph_t * g) #endif #endif ) - emit_reset(gvc, g); + emit_reset(gvc, g); /* FIXME - split into emit_init & page reset */ switch (gvc->job->output_lang) { case GVRENDER_PLUGIN: flags = chkOrder(g); diff --git a/lib/common/renderprocs.h b/lib/common/renderprocs.h index 5e3974de0..d48ed5a8d 100644 --- a/lib/common/renderprocs.h +++ b/lib/common/renderprocs.h @@ -62,7 +62,6 @@ extern "C" { extern point dotneato_closest(splines * spl, point p); extern void graph_init(graph_t * g); extern void dotneato_initialize(GVC_t * gvc, int, char **); - extern void setCmdName(char *); extern void dotneato_usage(int); extern void dotneato_postprocess(Agraph_t *, nodesizefn_t); extern void dotneato_set_margins(GVC_t * gvc, Agraph_t *);