From: ellson Date: Fri, 1 Aug 2008 16:11:35 +0000 (+0000) Subject: fix breakages when WITH_CGRAPH not defined X-Git-Tag: LAST_LIBGRAPH~32^2~3727 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=45520a8af920d650669f20cc8205ae998c4f8e9e;p=graphviz fix breakages when WITH_CGRAPH not defined --- diff --git a/lib/agutil/dynattr.c b/lib/agutil/dynattr.c index 4a5c1aebe..759f3e260 100644 --- a/lib/agutil/dynattr.c +++ b/lib/agutil/dynattr.c @@ -14,13 +14,11 @@ * AT&T Research, Florham Park NJ * **********************************************************/ -#define WITH_CGRAPH 1 #ifdef WITH_CGRAPH #include #else #include #endif -#undef WITH_CGRAPH #include #include diff --git a/lib/agutil/nodeq.c b/lib/agutil/nodeq.c index f7a7e00bc..1959f2ac3 100644 --- a/lib/agutil/nodeq.c +++ b/lib/agutil/nodeq.c @@ -15,13 +15,11 @@ **********************************************************/ -#define WITH_CGRAPH 1 #ifdef WITH_CGRAPH #include #else #include #endif -#undef WITH_CGRAPH #include diff --git a/lib/cgraph/cghdr.h b/lib/cgraph/cghdr.h index cd8b75512..c0394423c 100644 --- a/lib/cgraph/cghdr.h +++ b/lib/cgraph/cghdr.h @@ -26,7 +26,7 @@ #include "config.h" #endif -#include +#include #include diff --git a/lib/common/render.h b/lib/common/render.h index 97a4c35f0..e719adbdc 100644 --- a/lib/common/render.h +++ b/lib/common/render.h @@ -50,9 +50,9 @@ extern "C" { #include "geomprocs.h" /* must follow geom.h (in types.h) */ #include "agxbuf.h" #ifdef WITH_CGRAPH -#include +#include "cgraph.h" #else -#include +#include "graph.h" #endif #include "utils.h" /* must follow types.h and agxbuf.h */ #include "gvplugin.h" /* must follow gvcext.h (in types.h) */ diff --git a/lib/common/types.h b/lib/common/types.h index 0e158ade6..a8d0df1e1 100644 --- a/lib/common/types.h +++ b/lib/common/types.h @@ -388,7 +388,6 @@ typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind; #ifdef WITH_CGRAPH -#include #define GD_drawing(g) (((Agraphinfo_t*)AGDATA(g))->drawing) #define GD_bb(g) (((Agraphinfo_t*)AGDATA(g))->bb) #define GD_gvc(g) (((Agraphinfo_t*)AGDATA(g))->gvc) @@ -401,7 +400,6 @@ typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind; #else -#include #define GD_bb(g) (g)->u.bb #define GD_cleanup(g) (g)->u.cleanup #define GD_dist(g) (g)->u.dist diff --git a/lib/gvc/gvc.c b/lib/gvc/gvc.c index 9b6a491eb..e1d20322f 100644 --- a/lib/gvc/gvc.c +++ b/lib/gvc/gvc.c @@ -21,9 +21,9 @@ #include "types.h" /*This code block should be replaced with only one onclude to cgraph*/ #ifdef WITH_CGRAPH -#include +#include "cgraph.h" #else -#include +#include "graph.h" #endif /********************/ diff --git a/lib/gvc/gvc.h b/lib/gvc/gvc.h index e0b77a44a..30a69ddd9 100644 --- a/lib/gvc/gvc.h +++ b/lib/gvc/gvc.h @@ -18,13 +18,11 @@ #define GVC_H #include "types.h" -#define WITH_CGRAPH 1 #ifdef WITH_CGRAPH -#include +#include "cgraph.h" #else -#include +#include "graph.h" #endif -#undef WITH_CGRAPH #ifdef __cplusplus extern "C" { diff --git a/lib/gvc/gvconfig.c b/lib/gvc/gvconfig.c index 6b019f89d..3162c74f8 100644 --- a/lib/gvc/gvconfig.c +++ b/lib/gvc/gvconfig.c @@ -54,9 +54,9 @@ static int glob (char*, int, int (*errfunc)(const char *, int), glob_t*); #include "types.h" /*This code block should be replaced with only one onclude to cgraph*/ #ifdef WITH_CGRAPH -#include +#include "cgraph.h" #else -#include +#include "graph.h" #endif /********************/ diff --git a/lib/gvc/gvcontext.c b/lib/gvc/gvcontext.c index 9391c05fd..8511842d8 100644 --- a/lib/gvc/gvcontext.c +++ b/lib/gvc/gvcontext.c @@ -29,9 +29,9 @@ #include "types.h" /*This code block should be replaced with only one onclude to cgraph*/ #ifdef WITH_CGRAPH -#include +#include "cgraph.h" #else -#include +#include "graph.h" #endif /********************/ #include "gvplugin.h" diff --git a/lib/gvc/gvevent.c b/lib/gvc/gvevent.c index b3f101da6..7c3613a80 100644 --- a/lib/gvc/gvevent.c +++ b/lib/gvc/gvevent.c @@ -23,9 +23,9 @@ #include "gvplugin_layout.h" #ifdef WITH_CGRAPH -#include +#include "cgraph.h" #else -#include +#include "graph.h" #endif #include "gvcint.h" diff --git a/lib/gvc/gvlayout.c b/lib/gvc/gvlayout.c index 276a234fe..da87c7d08 100644 --- a/lib/gvc/gvlayout.c +++ b/lib/gvc/gvlayout.c @@ -28,9 +28,9 @@ #include "gvcint.h" #ifdef WITH_CGRAPH -#include +#include "cgraph.h" #else -#include +#include "graph.h" #endif #include "gvcproc.h" @@ -68,9 +68,17 @@ int gvLayoutJobs(GVC_t * gvc, graph_t * g) return -1; GD_gvc(g) = gvc; +#ifdef WITH_CGRAPH if (g != agroot(g)) GD_gvc(agroot(g)) = gvc; +#else + if (g != g->root) GD_gvc(g->root) = gvc; +#endif graph_init(g, gvc->layout.features->flags & LAYOUT_USES_RANKDIR); +#ifdef WITH_CGRAPH GD_drawing(agroot(g)) = GD_drawing(g); +#else + GD_drawing(g->root) = GD_drawing(g); +#endif if (gvle && gvle->layout) { gvle->layout(g); if (gvle->cleanup) @@ -96,7 +104,11 @@ int gvFreeLayout(GVC_t * gvc, graph_t * g) if (GD_drawing(g)) { graph_cleanup(g); GD_drawing(g) = NULL; +#ifdef WITH_CGRAPH GD_drawing(agroot(g)) = NULL; +#else + GD_drawing(g->root) = NULL; +#endif } return 0; } diff --git a/lib/gvc/gvloadimage.c b/lib/gvc/gvloadimage.c index b476168f5..ba0eee8f3 100644 --- a/lib/gvc/gvloadimage.c +++ b/lib/gvc/gvloadimage.c @@ -32,13 +32,11 @@ #include "gvcproc.h" /* for agerr() */ -#define WITH_CGRAPH 1 #ifdef WITH_CGRAPH -#include +#include "cgraph.h" #else -#include +#include "graph.h" #endif -#undef WITH_CGRAPH static int gvloadimage_select(GVJ_t * job, char *str) { diff --git a/lib/gvc/gvplugin.c b/lib/gvc/gvplugin.c index c8a553682..fcee82996 100644 --- a/lib/gvc/gvplugin.c +++ b/lib/gvc/gvplugin.c @@ -27,9 +27,9 @@ #include "types.h" #ifdef WITH_CGRAPH -#include +#include "cgraph.h" #else -#include +#include "graph.h" #endif #include "gvplugin.h" diff --git a/lib/gvc/gvrender.c b/lib/gvc/gvrender.c index 222e25d16..8410e7867 100644 --- a/lib/gvc/gvrender.c +++ b/lib/gvc/gvrender.c @@ -31,13 +31,11 @@ #include "colorprocs.h" #include "gvplugin_render.h" -#define WITH_CGRAPH 1 #ifdef WITH_CGRAPH -#include +#include "cgraph.h" #else -#include +#include "graph.h" #endif -#undef WITH_CGRAPH #include "gvcint.h" diff --git a/lib/gvc/gvusershape.c b/lib/gvc/gvusershape.c index 2027f37de..aa49f9e9b 100644 --- a/lib/gvc/gvusershape.c +++ b/lib/gvc/gvusershape.c @@ -26,13 +26,11 @@ #include "logic.h" #include "memory.h" -#define WITH_CGRAPH 1 #ifdef WITH_CGRAPH -#include +#include "cgraph.h" #else -#include +#include "graph.h" #endif -#undef WITH_CGRAPH #include "agxbuf.h" #include "utils.h" diff --git a/lib/neatogen/circuit.c b/lib/neatogen/circuit.c index 3f2cde482..0c36ac4b0 100644 --- a/lib/neatogen/circuit.c +++ b/lib/neatogen/circuit.c @@ -21,7 +21,9 @@ * Return 1 if successful; 0 otherwise (e.g., graph is disconnected). */ #include "neato.h" +#ifdef WITH_CGRAPH #include "cgraph.h" +#endif int solveCircuit(int nG, double **Gm, double **Gm_inv) {