eliminate public func setCmdName
authorellson <devnull@localhost>
Thu, 6 Jan 2005 04:04:20 +0000 (04:04 +0000)
committerellson <devnull@localhost>
Thu, 6 Jan 2005 04:04:20 +0000 (04:04 +0000)
don't reset Deffontname

cmd/dot/dot.c
lib/common/emit.c
lib/common/input.c
lib/common/output.c
lib/common/renderprocs.h

index 473b08fc66dc60c3da9f55b776886a8229f5b9f1..f1dc477f73b1a7e13946fe371d3f99869549d89f 100644 (file)
@@ -23,7 +23,6 @@
 #endif
 
 #include <stdio.h>
-#include <libgen.h>
 #include <time.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
@@ -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
index cc8d3c360abcb57ac4829f248d84fa907e4936c8..24811fa010ede0ef766cb0c07281b6ea45b8d369 100644 (file)
@@ -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;
index f9381e3635465fad775363965fb0e8e560bb75d4..453bdb2a20f44877eded73c3fab938d56274dbaf 100644 (file)
 *              AT&T Research, Florham Park NJ             *
 **********************************************************/
 
+#include       <ctype.h>
+#include       <libgen.h>
+
 #include       "render.h"
 #include       "htmltable.h"
-#include       <ctype.h>
 
 #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]);
index 7eac4946fb2ab5313ee6aaa12fab95701bafd550..c37773e5a2217cc6365f0b4be0cb6548edaab5a8 100644 (file)
@@ -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);
index 5e3974de0075af38157ca1fe14262391907f3b2e..d48ed5a8d6e89a860bbeb90a3f4a80fcf3a05fec 100644 (file)
@@ -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 *);