From: ellson Date: Mon, 2 Mar 2009 14:11:44 +0000 (+0000) Subject: fix problem with graph iodisc X-Git-Tag: LAST_LIBGRAPH~32^2~2348 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f457de2936ad389f27375c86d0a8ea566a8892e6;p=graphviz fix problem with graph iodisc --- diff --git a/ChangeLog b/ChangeLog index c21607b31..c09bb68c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,14 +1,13 @@ -February 26, 2009 - - Preparation for Release 2.22 +March 1, 2009 + - Release 2.22 - Core: - libgvc api changed, version bumped. Affects third party applications using libgvc. - plugin api changed, version bumped. Affects third party plugins for graphviz. - - 90% conversion to libgraph done, not in use yet, (and yes, - its true what they say about the last 10% ) - - Internal layout code completely converted to floating - point. + - 90% conversion to cgraph has been done, but not enabled yet, + (and yes, its true what they say about the last 10% ) + - layout code completely converted to floating point. - new "dot -P" option for generating a graph of available plugins. - Plugins: @@ -32,7 +31,7 @@ February 26, 2009 - Improved GUI - Windows: - VisualC project files now available, in addition to the GNU - Makefiles that are used the mingw builds. + Makefiles that are used the mingw builds. - Language Bindings: - fixed problem with writing dot, xdot, plain, canon to memory or to Tcl_Channels @@ -51,7 +50,6 @@ February 26, 2009 1568, 1569, 1570, 1571, 1573, 1577, 1578, 1579, 1580, 1581, 1582, 1584, 1586, - August 2, 2008 - drop libagraph from distribution - part of migration to libcgraph - rename file format from .dot to .gv to avoid conflict with Word templates diff --git a/cmd/tools/gvpack.c b/cmd/tools/gvpack.c index 37cf60681..ef8262e6f 100644 --- a/cmd/tools/gvpack.c +++ b/cmd/tools/gvpack.c @@ -31,7 +31,6 @@ #include #include "gvc.h" -#include "gvio.h" #include "render.h" #include "neatoprocs.h" #include "ingraphs.h" @@ -163,7 +162,6 @@ static void init(int argc, char *argv[]) int c; aginit(); - agsetiodisc(NULL, gvfwrite, gvferror); while ((c = getopt(argc, argv, ":ngvum:o:G:?")) != -1) { switch (c) { case 'n': diff --git a/lib/graph/attribs.c b/lib/graph/attribs.c index b959c6c0d..83973cf33 100644 --- a/lib/graph/attribs.c +++ b/lib/graph/attribs.c @@ -340,7 +340,6 @@ void aginitlib(int gs, int ns, int es) AG.node_nbytes = ns; AG.edge_nbytes = es; AG.init_called = TRUE; - AG.fgets = fgets; /* init to system version of fwrite() */ AG.fwrite = fwrite; /* init to system version of fwrite() */ #if defined(__SUNPRO_C) || defined(__CYGWIN__) || defined(__MINGW32__) #undef ferror diff --git a/lib/graph/graphio.c b/lib/graph/graphio.c index a81d84392..f9e255cf6 100644 --- a/lib/graph/graphio.c +++ b/lib/graph/graphio.c @@ -586,6 +586,18 @@ int agwrite(Agraph_t * g, FILE * fp) printdict_t *p; char *t0, *t1; + if (AG.fwrite == NULL) { + AG.fwrite = fwrite; /* init to system version of fwrite() */ + } + if (AG.ferror == NULL) { +#if defined(__SUNPRO_C) || defined(__CYGWIN__) || defined(__MINGW32__) +#undef ferror + AG.ferror = agferror; /* init to ferror macro wrapper function */ +#else + AG.ferror = ferror; /* init to system version of ferror() */ +#endif + } + /* write the graph header */ t0 = (AG_IS_STRICT(g)) ? "strict " : ""; t1 = (AG_IS_DIRECTED(g)) ? "digraph" : "graph"; diff --git a/lib/graph/lexer.c b/lib/graph/lexer.c index b1633ab52..c41c8c82a 100644 --- a/lib/graph/lexer.c +++ b/lib/graph/lexer.c @@ -77,6 +77,8 @@ void aglexinit(FILE * fp, gets_f mygets) Lexer_fp = fp; if (mygets) AG.fgets = mygets; + if (AG.fgets == NULL) + AG.fgets = fgets; LexPtr = NULL; if (AG.linebuf == NULL) { LineBufSize = BUFSIZ;