]> granicus.if.org Git - graphviz/commitdiff
cleaning up on set of headers installed from common and gvc
authorellson <devnull@localhost>
Tue, 18 Oct 2005 18:48:34 +0000 (18:48 +0000)
committerellson <devnull@localhost>
Tue, 18 Oct 2005 18:48:34 +0000 (18:48 +0000)
18 files changed:
Doxyfile.in
cmd/dot/dot.c
lib/common/Makefile.am
lib/common/Makefile.old
lib/common/arith.h
lib/common/render.h
lib/common/types.h
lib/common/utils.c
lib/common/utils.h
lib/gvc/Makefile.am
lib/gvc/Makefile.old
lib/gvc/gvc.c
lib/gvc/gvc.h
lib/gvc/gvcproc.h
tclpkg/gv/gv.cpp
tclpkg/gv/gv.i
tclpkg/tcldot/tcldot.c
tclpkg/tcldot/tkgen.c

index 0c5ffdef7aa07d5ad3759b4db7b6c3aeb5b3c900..f392c2ae52950973d9b3fe4245fdfe728e1711de 100644 (file)
@@ -417,7 +417,7 @@ WARN_LOGFILE           =
 # directories like "/usr/src/myproject". Separate the files or directories 
 # with spaces.
 
-INPUT                  = cmd/dot \
+INPUT = cmd/dot \
        lib/cdt \
        lib/circogen \
        lib/common \
@@ -429,7 +429,8 @@ INPUT                  = cmd/dot \
        lib/pack \
        lib/pathplan \
        lib/twopigen \
-       lib/plugin
+       lib/plugin \
+       tclpkg/gv
 
 # If the value of the INPUT tag contains directories, you can use the 
 # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
index 50abf6093192ceefb4bab4fdaa3e6e16f0e2202a..a594713c4b6ead9389161e4c0cd7b95657f9fe8c 100644 (file)
@@ -134,11 +134,11 @@ int main(int argc, char **argv)
 {
     graph_t *prev = NULL;
 
-    Gvc = gvNEWcontext(Info, username());
+    Gvc = gvNEWcontext(Info, gvUsername());
     gvParseArgs(Gvc, argc, argv);
 
 #ifndef MSWIN32
-    signal(SIGUSR1, toggle);
+    signal(SIGUSR1, gvToggle);
     signal(SIGINT, intr);
     fpinit();
 #endif
index da7ef971d8fc6572954ca827b838183aa86215ff..b91b683b777905db9e278f2153997d2264738284 100644 (file)
@@ -9,10 +9,10 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/lib/graph \
        -I$(top_srcdir)/lib/cdt  @GD_INCLUDES@ @EXPAT_INCLUDES@ @Z_INCLUDES@
 
-pkginclude_HEADERS = logic.h arith.h geom.h geomprocs.h \
-       color.h colorprocs.h colortbl.h \
-       const.h macros.h types.h globals.h utils.h memory.h \
-       htmllex.h htmltable.h pointset.h render.h
+pkginclude_HEADERS = logic.h arith.h geom.h color.h types.h globals.h
+noinst_HEADERS = render.h utils.h memory.h \
+       geomprocs.h colorprocs.h colortbl.h \
+       const.h macros.h htmllex.h htmltable.h pointset.h
 noinst_LTLIBRARIES = libcommon.la
 
 if !DISABLE_CODEGENS
index 5d074b7072ebd09ddaf6094d05a105054927196e..c2a9034f0f23737b58c703053a3e056087393732 100644 (file)
@@ -18,11 +18,10 @@ DEFINES = -DHAVE_CONFIG_H
 
 AWKDIR = $(ROOT)/awk
 
-INST_HDRS = const.h globals.h macros.h render.h \
-       types.h utils.h geom.h geomprocs.h logic.h \
-       color.h colorprocs.h arith.h memory.h
-
-NOINST_HDRS = colortbl.h ps.h htmltable.h htmlparse.h htmllex.h
+INST_HDRS = logic.h arith.h geom.h color.h types.h globals.h
+NOINST_HDRS = render.h utils.h memory.h \
+       geomprocs.h colorprocs.h const.h macros.h h pointset.h
+NOINST_GENERATED_HDRS = colortbl.h ps.h htmltable.h  htmlparse.h htmllex.h 
 
 OBJS = args.o arrows.o gdusershape.o mapgen.o psgen.o svgusershape.o \
        colxlate.o globals.o mifgen.o psusershape.o timing.o \
@@ -55,7 +54,7 @@ install: libcommon.a
        $(MKPATH) $(LIBDIR)
        $(INSTALL) libcommon.a $(LIBDIR)
 
-$(OBJS) : $(INST_HDRS)
+$(OBJS) : $(INST_HDRS) $(NOINST_HDRS)
 colxlate.o : colortbl.h
 psgen.o : ps.h
 emit.o mapgen.o utils.o htmllex.o htmltable.o htmlparse.o : htmltable.h
index d9ade4a12a24f037a9df76c2ae60d1cf834687d5..0d35e2c660deb3e92c56c886e0b300f2f2ea0fc3 100644 (file)
 #ifndef GV_ARITH_H
 #define GV_ARITH_H
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 /* for sincos */
 #define _GNU_SOURCE 1
 #ifdef HAVE_LIMITS_H
index e2d538d31dff041f020e21476923da20d0514c12..8d1d0c1a00062409538091dbb1edbba596313edc 100644 (file)
@@ -25,17 +25,6 @@ extern "C" {
 #include "config.h"
 #endif
 
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#else
-#ifdef HAVE_VALUES_H
-#include <values.h>
-#endif
-#endif
-
-#include <signal.h>
-#include <assert.h>
-#include <stdio.h>
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
@@ -52,9 +41,9 @@ extern "C" {
 #include <string.h>
 #endif
 
+#include "types.h"
 #include "macros.h"
 #include "const.h"
-#include "types.h"
 #include "globals.h"
 #include "memory.h"
 #include "colorprocs.h"                /* must collow color.h (in types.h) */
index 9fb3a663eff50d453e9065ce87a9ad214cbfe349..4d2af6372dbad07942da55acbc44d2ef001a6d02 100644 (file)
@@ -18,6 +18,8 @@
 #define GV_TYPES_H
 
 #include <stdio.h>
+#include <assert.h>
+#include <signal.h>
 
 #include "geom.h"
 #include "pathplan.h"
index 4d59c957b573e6d17fdd77c2dfa2ae709f603b2c..0a68bbdd37c787685054fe003aa8ef0e6497d6ad 100644 (file)
@@ -261,7 +261,7 @@ static void cleanup(void)
 }
 #endif
 
-char *username()
+char *gvUsername()
 {
     char *user = NULL;
 #ifndef MSWIN32
@@ -590,11 +590,11 @@ point neato_closest(splines * spl, point p)
 }
 
 static int Tflag;
-void toggle(int s)
+void gvToggle(int s)
 {
     Tflag = !Tflag;
 #ifndef MSWIN32
-    signal(SIGUSR1, toggle);
+    signal(SIGUSR1, gvToggle);
 #endif
 }
 
index 0b6f7afed5472f57519565838dc80980188f4863..ee66a399888a1419069c82cd910a084f0b1bf8e6 100644 (file)
@@ -43,14 +43,12 @@ extern "C" {
     extern void UF_singleton(Agnode_t *);
     extern void UF_setname(Agnode_t *, Agnode_t *);
 
-    extern char *username(void);
     extern char *safefile(char *shapefilename);
     extern void cat_libfile(FILE *, char **, char **);
 
     extern int mapbool(char *);
     extern int maptoken(char *, char **, int *);
 
-    extern void toggle(int);
     extern int test_toggle(void);
 
     extern void common_init_node(node_t * n);
index 09001655649049c6fa289171c0beae73554151cf..b8992a909535ac125eb4d879f70df0d6483e08a9 100644 (file)
@@ -12,9 +12,13 @@ AM_CPPFLAGS = \
 
 LIBS = $(LIBLTDL) $(SOCKET_LIBS)
 
-pkginclude_HEADERS = gvc.h gvcint.h gvcjob.h gvcext.h gvplugin.h gvcproc.h \
-       gvplugin_render.h gvplugin_layout.h gvplugin_textlayout.h \
-       gvplugin_device.h gvplugin_usershape.h
+pkginclude_HEADERS = gvc.h gvcext.h gvplugin.h gvcjob.h gvcint.h \
+       gvplugin_render.h \
+       gvplugin_layout.h \
+       gvplugin_textlayout.h \
+       gvplugin_device.h \
+       gvplugin_usershape.h
+noinst_HEADERS = gvcproc.h
 pkglib_LTLIBRARIES = libgvc.la
 pkgconfig_DATA = libgvc.pc
 
index c092b0073d70c83def7449831dab85d79f4f9747..8de36b8b158b09f492227798356b9430143052b3 100644 (file)
@@ -13,11 +13,13 @@ INCS =  -I. \
 
 DEFINES = -DHAVE_CONFIG_H -DGVLIBDIR=\"$(LIBDIR)\"
 
-HDRS = gvc.h gvcint.h gvcjob.h gvcext.h gvcproc.h gvplugin.h \
+INST_HDRS = gvc.h gvcint.h gvcjob.h gvcext.h gvplugin.h \
        gvplugin_render.h gvplugin_device.h \
        gvplugin_layout.h gvplugin_textlayout.h \
        gvplugin_usershape.h
 
+NOINST_HDRS = gvcproc.h
+
 OBJS = gvrender.o gvlayout.o gvdevice.o gvcontext.o gvjobs.o \
        gvplugin.o gvconfig.o gvevent.o gvtextlayout.o gvusershape.o gvc.o
 
index 872aed5b90e5e3b7fc3d83ef9ab8010dcdef3631..dc48ac179b358812bf1000b6e980272f8eab1151 100644 (file)
@@ -19,6 +19,9 @@
 #include "gvcint.h"
 #include "gvcproc.h"
 
+extern GVC_t *gvNEWcontext(char **info, char *user);
+extern char *gvUsername(void);
+
 char *LibInfo[] = {
     "libgvc",          /* Program */
     VERSION,           /* Version */
@@ -31,7 +34,7 @@ GVC_t *gvContext(void)
 
     aginit();
     agnodeattr(NULL, "label", NODENAME_ESC);
-    gvc = gvNEWcontext(LibInfo, username());
+    gvc = gvNEWcontext(LibInfo, gvUsername());
     gvconfig(gvc, FALSE); /* configure for available plugins and codegens */
     return gvc;
 }
@@ -75,6 +78,7 @@ int gvLayout(GVC_t *gvc, graph_t *g, char *engine)
     return 0;
 }
 
+/* Render layout in a specified format to an open FILE */
 int gvRender(GVC_t *gvc, graph_t *g, char *format, FILE *out)
 {
     int rc;
@@ -92,8 +96,39 @@ int gvRender(GVC_t *gvc, graph_t *g, char *format, FILE *out)
 
     job = gvc->job;
     job->output_lang = gvrender_select(job, job->output_langname);
+    if (!GD_drawing(g) && job->output_lang != CANONICAL_DOT) {
+       fprintf(stderr, "Layout was not done\n");
+       return -1;
+    }
     job->output_file = out;
+    gvRenderJobs(gvc, g);
+    gvrender_delete_jobs(gvc);
+
+    return 0;
+}
+
+/* Render layout in a specified format to an open FILE */
+int gvRenderFilename(GVC_t *gvc, graph_t *g, char *format, char *filename)
+{
+    int rc;
+    GVJ_t *job;
 
+    g = g->root;
+
+    /* create a job for the required format */
+    rc = gvrender_output_langname_job(gvc, format);
+    if (rc == NO_SUPPORT) {
+       agerr(AGERR, "Renderer type: \"%s\" not recognized. Use one of:%s\n",                format, gvplugin_list(gvc, API_render, format));
+       return -1;
+    }
+
+    job = gvc->job;
+    job->output_lang = gvrender_select(job, job->output_langname);
+    if (!GD_drawing(g) && job->output_lang != CANONICAL_DOT) {
+       fprintf(stderr, "Layout was not done\n");
+       return -1;
+    }
+    gvrender_output_filename_job(gvc, filename);
     gvRenderJobs(gvc, g);
     gvrender_delete_jobs(gvc);
 
index 2f40b7e4a908e73f6d34db6526c113f75943fe5a..ab20bf30c9a6cf278277eb0eebf31c83f54e912b 100644 (file)
 #ifndef                        GVC_H
 #define                        GVC_H
 
-#include "render.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "types.h"
+#include "globals.h"
+#include "graph.h"
 #include "gvplugin.h"
-#include "gvcint.h"
-#include "gvcproc.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -50,23 +54,34 @@ extern "C" {
 #define gvCleanup gvCleanup_DEPRECATED_BY_gvFreeContext
 #define dotneato_terminate dotneato_terminate_DEPRECATED_BY_gvFreeContext
 
+/* misc */
+/* FIXME - these need eliminating or renaming */
+extern void gvToggle(int);
+extern graph_t *next_input_graph(void);
 
 /* set up a graphviz context */
+extern GVC_t *gvNEWcontext(char **info, char *user);
+extern char *gvUsername(void);
+
+/*  set up a graphviz context - alternative */
+/*     (wraps the above two functions using info built into libgvc) */
 extern GVC_t *gvContext(void);
 
 /* parse command line args - minimally argv[0] sets layout engine */
 extern int gvParseArgs(GVC_t *gvc, int argc, char **argv);
 
-
 /* Compute a layout using a specified engine */
 extern int gvLayout(GVC_t *gvc, graph_t *g, char *engine);
 
 /* Compute a layout using layout engine from command line args */
 extern int gvLayoutJobs(GVC_t *gvc, graph_t *g);
 
-/* Render layout in a specified format to a specified output file */
+/* Render layout in a specified format to an open FILE */
 extern int gvRender(GVC_t *gvc, graph_t *g, char *format, FILE *out);
 
+/* Render layout in a specified format to an open FILE */
+extern int gvRenderFilename(GVC_t *gvc, graph_t *g, char *format, char *filename);
+
 /* Render layout according to -T and -o options found by gvParseArgs */
 extern int gvRenderJobs(GVC_t *gvc, graph_t *g);
 
index 05fae3bd1caae3bdc446bdaee3cf5d6790981e9e..3ae29f65abf6a5533d7aa28c00b1f6e5609fd77f 100644 (file)
@@ -25,10 +25,6 @@ extern "C" {
 
 /* these are intended to be private entry points - see gvc.h for the public ones */
 
-/* context */
-
-    extern GVC_t *gvNEWcontext(char **info, char *user);
-
 /* configuration */
 
     extern char *gvconfig_libdir(void);
index 8773ef723342afe971637573c2a20e47dc6d857d..7dd3dd27c7cf1fccb8042b1b8385dfa7155c8551 100644 (file)
 *              AT&T Research, Florham Park NJ             *
 **********************************************************/
 
-#define BUILTINS
 #include "gvc.h"
+#include "graph.h"
 
 GVC_t *gvc;
 
-char *Info[] = {
-    "gv",
-    VERSION,
-    BUILDDATE
-};
-
 static void gvinit()
 {
-    aginit();
-    agnodeattr(NULL, "label", NODENAME_ESC);
-    gvc = gvNEWcontext(Info, username());
-
-    /* configure for available plugins and codegens */
-    gvconfig(gvc, FALSE);
+    gvc = gvContext();
 }
 
 Agraph_t *digraph(char *name)
@@ -247,49 +236,16 @@ void rm(Agedge_t *e)
     agdelete(e->head->graph->root, e);
 }
 
-static void reset_layout(Agraph_t *g)
-{
-    g = g->root;
-    if (GD_drawing(g)) {        /* only cleanup once between layouts */
-       gvFreeLayout(gvc, g);
-        GD_drawing(g) = NULL;
-    }
-}
-
 void layout(Agraph_t *g, char *engine)
 {
     int err;
 
     err = gvLayout(gvc, g, engine);
-    if (err) {
-       fprintf(stderr, "Layout type: \"%s\" not recognized. Use one of:%s\n",                engine, gvplugin_list(gvc, API_layout, engine));
-       return;
-    }
 }
 
 void writegraph(Agraph_t *g, char *filename, char *format)
 {
     int err;
-    GVJ_t *job;
-
-    g = g->root;
 
-    /* create a job for the required format */
-    err = gvrender_output_langname_job(gvc, format);
-    if (err == NO_SUPPORT) {
-        fprintf(stderr, "Renderer type: \"%s\" not recognized. Use one of:%s\n",
-               format, gvplugin_list(gvc, API_render, format));
-        return;
-    }
-
-    job = gvc->job;
-    job->output_lang = gvrender_select(job, job->output_langname);
-    if (!GD_drawing(g) && job->output_lang != CANONICAL_DOT) {
-        fprintf(stderr, "Layout was not done\n");
-        return;
-    }
-    gvrender_output_filename_job(gvc, filename);
-    
-    gvRenderJobs(gvc, g);
-    gvrender_delete_jobs(gvc);
+    err = gvRenderFilename(gvc, g, format, filename);
 }
index 8c7f9b17eee4a9d422bcbf9bdf6cdf7b2fee0159..f40735d44616ce1a71cf4e60ef7a0319201b23a5 100644 (file)
@@ -16,6 +16,7 @@
 
 %module gv
 %{
+#define BUILTINS
 #include "gvc.h"
 %}
 
index bd9d0ec0b311a32435a5e201f1df42eb09a46c4e..28011fda0948c5f6dd66422081868f26ec6f4001 100644 (file)
@@ -18,7 +18,9 @@
 /* avoid compiler warnings with template changes in Tcl8.4 */
 /*    specifically just the change to Tcl_CmdProc */
 #define USE_NON_CONST
+#define BUILTINS
 
+#include "render.h"
 #include "gvc.h"
 #include "tcl.h"
 #include "tclhandle.h"
@@ -1645,7 +1647,7 @@ int Tcldot_Init(Tcl_Interp * interp)
     agnodeattr(NULL, "label", NODENAME_ESC);
 
     /* create a GraphViz Context and pass a pointer to it in clientdata */
-    gvc = gvNEWcontext(Info, username());
+    gvc = gvNEWcontext(Info, gvUsername());
 
     /* configure for available plugins and codegens */
     gvconfig(gvc, FALSE);
index fa38aac57cb0b9411db24165ec7b5ca699f2b565..dcdba9a459fff36f911aef8ac66a447546e9d2bf 100644 (file)
@@ -21,6 +21,7 @@
 
 /* builtins are defined in tcldot.c  - prevent duplicate */
 #define BUILTINS 
+#include "render.h"
 #include "gvc.h"
 
 #include "tcl.h"