From: ellson Date: Wed, 15 Oct 2008 13:17:01 +0000 (+0000) Subject: making progress X-Git-Tag: LAST_LIBGRAPH~32^2~3114 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f301613cc6b70ec434a3377f229ccfe3a515acc;p=graphviz making progress --- diff --git a/lib/common/mpgen.c b/lib/common/mpgen.c index 54319cd29..673f806bb 100644 --- a/lib/common/mpgen.c +++ b/lib/common/mpgen.c @@ -107,7 +107,7 @@ mp_begin_job(FILE * ofp, graph_t * g, const char **lib, char *user, char *info[] fprintf(Output_file, "%% Created by program: %s version %s (%s)\n", info[0], info[1], info[2]); fprintf(Output_file, "%% For user: %s\n", user); - fprintf(Output_file, "%% Title: %s\n", g->name); + fprintf(Output_file, "%% Title: %s\n", agnameof(g)); fprintf(Output_file, "%% Put this between beginfig and endfig. See 1st_read.mp.\n"); fprintf(Output_file, "%% \n"); diff --git a/lib/common/picgen.c b/lib/common/picgen.c index 7e7ec02c2..500b739a1 100644 --- a/lib/common/picgen.c +++ b/lib/common/picgen.c @@ -170,7 +170,7 @@ static void pic_begin_job(FILE * ofp, graph_t * g, const char **lib, char *user, fprintf(Output_file, "%s Creator: %s version %s (%s)\n", EscComment, info[0], info[1], info[2]); fprintf(Output_file, "%s For: %s\n", EscComment, user); - fprintf(Output_file, "%s Title: %s\n", EscComment, g->name); + fprintf(Output_file, "%s Title: %s\n", EscComment, agnameof(g)); } static void pic_begin_graph(GVC_t * gvc, graph_t * g, box bb, point pb) @@ -310,13 +310,13 @@ static void pic_end_page(void) static void pic_begin_node(node_t * n) { - fprintf(Output_file, "%s\t%s\n", EscComment, n->name); + fprintf(Output_file, "%s\t%s\n", EscComment, agnameof(n)); } static void pic_begin_edge(edge_t * e) { - fprintf(Output_file, "%s\t%s -> %s\n", EscComment, e->tail->name, - e->head->name); + fprintf(Output_file, "%s\t%s -> %s\n", EscComment, + agnameof(agtail(e)), agnameof(aghead(e))); } static void pic_begin_context(void) diff --git a/lib/common/shapes.c b/lib/common/shapes.c index 289ee95e0..774776185 100644 --- a/lib/common/shapes.c +++ b/lib/common/shapes.c @@ -336,7 +336,11 @@ static int stylenode(GVJ_t * job, node_t * n) if ((pstyle = checkStyle(n, &istyle))) gvrender_set_style(job, pstyle); +#ifndef WITH_CGRAPH if (N_penwidth && ((s=agxget(n, N_penwidth->index)) && s[0])) { +#else + if (N_penwidth && ((s=agxget(n, N_penwidth)) && s[0])) { +#endif penwidth = late_double(n, N_penwidth, 1.0, 0.0); gvrender_set_penwidth(job, penwidth); } @@ -868,7 +872,7 @@ static void poly_init(node_t * n) if ((width < bb.x) || (height < bb.y)) agerr(AGWARN, "node '%s', graph '%s' size too small for label\n", - agnameof(n), agraphof(n)->name); + agnameof(n), agnameof(agraphof(n))); bb.x = width; bb.y = height; } @@ -2552,8 +2556,8 @@ void resolvePorts (edge_t* e) { if (ED_tail_port(e).dyna) - ED_tail_port(e) = resolvePort(e->tail, e->head, &ED_tail_port(e)); + ED_tail_port(e) = resolvePort(agtail(e), aghead(e), &ED_tail_port(e)); if (ED_head_port(e).dyna) - ED_head_port(e) = resolvePort(e->head, e->tail, &ED_head_port(e)); + ED_head_port(e) = resolvePort(aghead(e), agtail(e), &ED_head_port(e)); } diff --git a/lib/common/utils.c b/lib/common/utils.c index 1523bf34f..6e1a832ae 100644 --- a/lib/common/utils.c +++ b/lib/common/utils.c @@ -895,21 +895,21 @@ Agsym_t *setAttr(graph_t * g, void *obj, char *name, char *value, ap = agraphattr(g, name, ""); #else /* WITH_CGRAPH */ case AGRAPH: - ap = agattr(g, AGRAPH,name, "",1); + ap = agattr(g, AGRAPH,name, ""); #endif /* WITH_CGRAPH */ break; case AGNODE: #ifndef WITH_CGRAPH ap = agnodeattr(g, name, ""); #else /* WITH_CGRAPH */ - ap = agattr(g,AGNODE, name, "",1); + ap = agattr(g,AGNODE, name, ""); #endif /* WITH_CGRAPH */ break; case AGEDGE: #ifndef WITH_CGRAPH ap = agedgeattr(g, name, ""); #else /* WITH_CGRAPH */ - ap = agattr(g,AGEDGE, name, "",1); + ap = agattr(g,AGEDGE, name, ""); #endif /* WITH_CGRAPH */ break; } @@ -1823,7 +1823,7 @@ void gv_cleanup_edge(edge_t * e) memset(&(e->u), 0, sizeof(Agedgeinfo_t)); #else /* WITH_CGRAPH */ /*FIX HERE , shallow cleaning may not be enough here */ - agdelrec(agraphof(e), e, "Agedgeinfo_t"); + agdelrec(e, "Agedgeinfo_t"); #endif /* WITH_CGRAPH */ } @@ -1837,7 +1837,7 @@ void gv_cleanup_node(node_t * n) memset(&(n->u), 0, sizeof(Agnodeinfo_t)); #else /* WITH_CGRAPH */ /*FIX HERE , shallow cleaning may not be enough here */ - agdelrec(agraphof(n), n, "Agnodeinfo_t"); + agdelrec(n, "Agnodeinfo_t"); #endif /* WITH_CGRAPH */ } diff --git a/lib/common/utils.h b/lib/common/utils.h index 01f79ac29..8afa3dffc 100644 --- a/lib/common/utils.h +++ b/lib/common/utils.h @@ -30,7 +30,14 @@ extern "C" { extern void enqueue(nodequeue *, Agnode_t *); extern Agnode_t *dequeue(nodequeue *); +#ifndef WITH_CGRAPH extern int late_attr(void *, char *); + extern attrsym_t* safe_dcl(graph_t*, void*, char*, char*, + attrsym_t * (*fun) (Agraph_t *, char *, char *)); +#else + extern attrsym_t* late_attr(void *obj, char *name); + extern attrsym_t* safe_dcl(graph_t * g, int obj_kind, char *name, char *def); +#endif extern int late_int(void *, Agsym_t *, int, int); extern double late_double(void *, Agsym_t *, double, double); extern char *late_nnstring(void *, Agsym_t *, char *); @@ -62,8 +69,6 @@ extern "C" { extern int processClusterEdges(graph_t * g); extern void undoClusterEdges(graph_t * g); - extern attrsym_t* safe_dcl(graph_t*, void*, char*, char*, - attrsym_t * (*fun) (Agraph_t *, char *, char *)); extern char *latin1ToUTF8(char *); extern char *htmlEntityUTF8(char *);