32 const int written = Tcl_Write((Tcl_Channel)(job->
output_file),
s, (
int)
len);
36 return (
size_t)written;
44 if (sscanf(
cmd,
"graph%p", &g) != 1 || !g)
51 if (sscanf(
cmd,
"node%p", &n) != 1 || !n)
58 if (sscanf(
cmd,
"edge%p", &e) != 1 || !e)
70 case AGRAPH: snprintf(buf,
sizeof(buf),
"graph%p", obj);
break;
71 case AGNODE: snprintf(buf,
sizeof(buf),
"node%p", obj);
break;
73 case AGOUTEDGE: snprintf(buf,
sizeof(buf),
"edge%p", obj);
break;
147 if (strcmp(a->
name,
"label") == 0 && val[0] ==
'<') {
148 size_t len = strlen(val);
149 if (val[
len-1] ==
'>') {
163 for (i = 0; i < argc; i++) {
175 for (i = 0; i < argc; i++) {
177 if (strcmp(argv[i],
"key") == 0) {
198 for (i = 0; i < argc; i++) {
215 Tcl_AppendElement(interp, a->
name);
222 Tcl_AppendElement(interp, a->
name);
229 Tcl_AppendElement(interp, a->
name);
245 if (strcasecmp(
engine,
"nop") == 0) {
256 char **argv_ret =
gv_calloc((
size_t)argc,
sizeof(
char *));
257 for (
int i = 0; i < argc; ++i) {
264 for (
int i = 0; i < argc; ++i) {
Memory allocation wrappers that exit on failure.
static char * gv_strdup(const char *original)
static void * gv_calloc(size_t nmemb, size_t size)
static double len(glCompPoint p)
Agsym_t * agattr(Agraph_t *g, int kind, char *name, const char *value)
creates or looks up attributes of a graph
Agsym_t * agnxtattr(Agraph_t *g, int kind, Agsym_t *attr)
permits traversing the list of attributes of a given type
int agxset(void *obj, Agsym_t *sym, const char *value)
#define agfindedgeattr(g, a)
Agedge_t * agnxtedge(Agraph_t *g, Agedge_t *e, Agnode_t *n)
Agedge_t * agfstedge(Agraph_t *g, Agnode_t *n)
#define agfindgraphattr(g, a)
int agisdirected(Agraph_t *g)
int agclose(Agraph_t *g)
deletes a graph, freeing its associated storage
Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Agnode_t * agfstnode(Agraph_t *g)
#define agfindnodeattr(g, a)
Agraph_t * agraphof(void *obj)
#define AGTYPE(obj)
returns AGRAPH, AGNODE, or AGEDGE depending on the type of the object
int agdelete(Agraph_t *g, void *obj)
deletes object. Equivalent to agclose, agdelnode, and agdeledge for obj being a graph,...
Agraph_t * agroot(void *obj)
char * agstrdup_html(Agraph_t *, const char *)
Agraph_t * agfstsubg(Agraph_t *g)
Agraph_t * agnxtsubg(Agraph_t *subg)
int agdelsubg(Agraph_t *g, Agraph_t *sub)
int gvFreeLayout(GVC_t *gvc, graph_t *g)
int gvLayout(GVC_t *gvc, graph_t *g, const char *engine)
Graphviz context library.
static gvloadimage_engine_t engine
platform abstraction for case-insensitive string functions
context used to convey information between commands and a renderer
struct Tcl_Interp * interp
TCL interpreter.
void tcldot_layout(GVC_t *gvc, Agraph_t *g, const char *engine)
void setgraphattributes(Agraph_t *g, char *argv[], int argc)
void listNodeAttrs(Tcl_Interp *interp, Agraph_t *g)
void listGraphAttrs(Tcl_Interp *interp, Agraph_t *g)
void deleteEdge(gctx_t *gctx, Agraph_t *g, Agedge_t *e)
void deleteNode(gctx_t *gctx, Agraph_t *g, Agnode_t *n)
size_t Tcldot_channel_writer(GVJ_t *job, const char *s, size_t len)
char * obj2cmd(void *obj)
Agraph_t * cmd2g(const char *cmd)
void deleteGraph(gctx_t *gctx, Agraph_t *g)
static void deleteGraphNodes(gctx_t *gctx, Agraph_t *g)
size_t Tcldot_string_writer(GVJ_t *job, const char *s, size_t len)
void listEdgeAttrs(Tcl_Interp *interp, Agraph_t *g)
Agedge_t * cmd2e(const char *cmd)
static void myagxset(void *obj, Agsym_t *a, char *val)
void setnodeattributes(Agraph_t *g, Agnode_t *n, char *argv[], int argc)
void setedgeattributes(Agraph_t *g, Agedge_t *e, char *argv[], int argc)
static void deleteNodeEdges(gctx_t *gctx, Agraph_t *g, Agnode_t *n)
void tcldot_argv_free(int argc, char *argv[])
free the strings pointed to by argv
char ** tcldot_argv_dup(int argc, const char *argv[])
duplicate the strings pointed to by argv as non-const strings
Agnode_t * cmd2n(const char *cmd)