From: ellson Date: Tue, 14 Oct 2008 21:23:10 +0000 (+0000) Subject: now try with the real cgraph sources !!!! X-Git-Tag: LAST_LIBGRAPH~32^2~3126 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9c1b056aaa741773190448418a355db7f94dedf1;p=graphviz now try with the real cgraph sources !!!! --- diff --git a/lib/common/Makefile.am b/lib/common/Makefile.am index de983a014..57e53e37d 100644 --- a/lib/common/Makefile.am +++ b/lib/common/Makefile.am @@ -22,14 +22,11 @@ if WITH_WIN32 AM_CFLAGS = -D_BLD_common=1 endif -if WITH_CGRAPH -else pkginclude_HEADERS = arith.h geom.h color.h types.h textpara.h usershape.h noinst_HEADERS = render.h utils.h memory.h \ geomprocs.h colorprocs.h colortbl.h entities.h globals.h \ logic.h const.h macros.h htmllex.h htmltable.h pointset.h noinst_LTLIBRARIES = libcommon_C.la -endif if WITH_CODEGENS CODEGENS = $(GD_CODEGENS) diagen.c hpglgen.c mifgen.c mpgen.c picgen.c vtxgen.c diff --git a/lib/common/htmltable.c b/lib/common/htmltable.c index 67453fbb9..ac8118e0c 100644 --- a/lib/common/htmltable.c +++ b/lib/common/htmltable.c @@ -1106,7 +1106,11 @@ static void checkChain(graph_t * g) edge_t *e; t = GD_nlist(g); for (h = ND_next(t); h; h = ND_next(h)) { +#ifdef WITH_CGRAPH + if (!agedge(g, t, h, (char *)NULL, FALSE)) { +#else if (!agfindedge(g, t, h)) { +#endif e = agedge(g, t, h); ED_minlen(e) = 0; elist_append(e, ND_out(t)); diff --git a/lib/common/types.h b/lib/common/types.h index aa3dca4cb..8f2de38bf 100644 --- a/lib/common/types.h +++ b/lib/common/types.h @@ -44,12 +44,17 @@ extern "C" { typedef int (*qsort_cmpf) (const void *, const void *); typedef int (*bsearch_cmpf) (const void *, const void *); +#ifdef WITH_CGRAPH + typedef struct Agraph_s graph_t; + typedef struct Agnode_s node_t; + typedef struct Agedge_s edge_t; + typedef struct Agsym_s attrsym_t; +#else typedef struct Agraph_t graph_t; - typedef struct Agnode_t node_t; typedef struct Agedge_t edge_t; - typedef struct Agsym_t attrsym_t; +#endif typedef struct htmllabel_t htmllabel_t; @@ -587,7 +592,7 @@ typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind; #define ED_weight(e) (e)->u.weight #define ED_xpenalty(e) (e)->u.xpenalty -#if WITH_CGRAPH +#ifdef WITH_CGRAPH #include "cgraph.h" #else #include "graph.h" diff --git a/lib/common/utils.c b/lib/common/utils.c index 681235502..ee6903ada 100644 --- a/lib/common/utils.c +++ b/lib/common/utils.c @@ -238,7 +238,11 @@ edge_t *debug_getedge(graph_t * g, char *s0, char *s1) n0 = agfindnode(g, s0); n1 = agfindnode(g, s1); if (n0 && n1) +#ifdef WITH_CGRAPH + return agedge(g, n0, n1, (char *)NULL, FALSE); +#else return agfindedge(g, n0, n1); +#endif else return NULL; }