]> granicus.if.org Git - graphviz/commit
Fixes a bug (# unknown) where tcldot or any gv language binding couldn't
authorellson <devnull@localhost>
Thu, 26 Feb 2009 03:10:13 +0000 (03:10 +0000)
committerellson <devnull@localhost>
Thu, 26 Feb 2009 03:10:13 +0000 (03:10 +0000)
commit93795c0fd2bf58e3fda1fb3bad6693e6b41d2af5
tree202f968d03a3d72c7b470cbab85e3543962e0f3c
parent90abad64101a253ddb15c2f3af5ecdfb0888e7a4
Fixes a bug (# unknown) where tcldot or any gv language binding couldn't
write dot,xdot,plain,canon to memory or to Tcl_Channels.

Problem was that agwrite() used fprintf() & putc() directly to an output file.

Fix is to add an output discipline to libgraph so that we can provide our own fwrite() equiv.

The discipline defaults to regular fwrite() and ferror() for backward compat.

Adds new functions to libgraph:
    extern void agsetodisc(
size_t (*fwrite) (FILE *fp, const char *s, size_t len),
int (*ferror) (FILE *fp));
    extern void agfprintf(FILE *fp, const char *format, ...);
    extern int agputs(const char *s, FILE *fp);
    extern int agputc(int c, FILE *fp);
13 files changed:
cmd/dot/dot.c
cmd/tools/gvpack.c
lib/common/output.c
lib/graph/attribs.c
lib/graph/graph.h
lib/graph/graphio.c
lib/graph/libgraph.h
lib/gvc/gvc.c
lib/gvc/gvdevice.c
lib/gvc/gvio.h
lib/gvc/gvplugin.c
plugin/core/gvrender_core_dot.c
tclpkg/tcldot/tcldot.c