* src/print_graph.c (print_actions): CPP out useless code.

* src/vcg.c (complain.h): Include it.
Unepitaize `return' invocations.
* src/vcg.c [NDEBUG] (main): Remove.
This commit is contained in:
Akim Demaille
2001-08-06 09:50:38 +00:00
parent 78348431f2
commit 3e3da79762
4 changed files with 249 additions and 301 deletions

View File

@@ -1,3 +1,10 @@
2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_@epita.fr>
* src/print_graph.c (print_actions): CPP out useless code.
* src/vcg.c (complain.h): Include it.
Unepitaize `return' invocations.
* src/vcg.c [NDEBUG] (main): Remove.
2001-08-06 Marc Autret <autret_@epita.fr> 2001-08-06 Marc Autret <autret_@epita.fr>
Automaton VCG graph output. Automaton VCG graph output.

View File

@@ -52,7 +52,7 @@ print_core (int state)
if (k == 0) if (k == 0)
return; return;
obstack_sgrow(&graph_obstack, "\t\tlabel:\t\""); obstack_sgrow (&graph_obstack, "\t\tlabel:\t\"");
for (i = 0; i < k; i++) for (i = 0; i < k; i++)
{ {
@@ -63,20 +63,20 @@ print_core (int state)
rule = -(*sp); rule = -(*sp);
obstack_fgrow1(&graph_obstack, _("%d: "), rule); obstack_fgrow1 (&graph_obstack, _("%d: "), rule);
obstack_fgrow1(&graph_obstack, " %s -> ", tags[rlhs[rule]]); obstack_fgrow1 (&graph_obstack, " %s -> ", tags[rlhs[rule]]);
for (sp = ritem + rrhs[rule]; sp < sp1; sp++) for (sp = ritem + rrhs[rule]; sp < sp1; sp++)
obstack_fgrow1(&graph_obstack, "%s ", tags[*sp]); obstack_fgrow1 (&graph_obstack, "%s ", tags[*sp]);
obstack_1grow(&graph_obstack, '.'); obstack_1grow (&graph_obstack, '.');
while (*sp > 0) while (*sp > 0)
obstack_fgrow1(&graph_obstack, " %s", tags[*sp++]); obstack_fgrow1 (&graph_obstack, " %s", tags[*sp++]);
obstack_sgrow(&graph_obstack, "\\n"); obstack_sgrow (&graph_obstack, "\\n");
} }
obstack_sgrow(&graph_obstack, "\"\n"); obstack_sgrow (&graph_obstack, "\"\n");
} }
static void static void
@@ -99,10 +99,12 @@ print_actions (int state, node_t *node)
if (!shiftp && !redp) if (!shiftp && !redp)
{ {
#if 0
if (final_state == state) if (final_state == state)
;//fprintf(f, " $default\taccept\n"); fprintf (f, " $default\taccept\n");
else else
;//fprintf(f, " NO ACTIONS\n"); fprintf (f, " NO ACTIONS\n");
#endif
return; return;
} }
@@ -193,11 +195,11 @@ print_state (int state)
new_node (&node); new_node (&node);
open_node (&graph_obstack); open_node (&graph_obstack);
sprintf(name, "%d", state); sprintf (name, "%d", state);
node.title = name; node.title = name;
output_node (&node, &graph_obstack); output_node (&node, &graph_obstack);
print_core (state); /* node label */ print_core (state); /* node label */
close_node (&graph_obstack); close_node (&graph_obstack);
@@ -211,7 +213,7 @@ print_graph (void)
int i; int i;
if (!graph_flag) if (!graph_flag)
return ; return;
new_graph (&graph); new_graph (&graph);
/* graph.smanhattan_edges = yes; /* graph.smanhattan_edges = yes;
@@ -233,8 +235,8 @@ print_graph (void)
output_graph (&graph, &graph_obstack); output_graph (&graph, &graph_obstack);
for (i = 0; i < nstates; i++) for (i = 0; i < nstates; i++)
/* Output nodes & edges. */ /* Output nodes & edges. */
print_state (i); print_state (i);
/* Close graph. */ /* Close graph. */
close_graph (&graph, &graph_obstack); close_graph (&graph, &graph_obstack);

View File

@@ -882,16 +882,11 @@ static void
parse_header_extension_decl (void) parse_header_extension_decl (void)
{ {
char buff[32]; char buff[32];
int len;
if (header_extension) if (header_extension)
complain (_("multiple %%header_extension declarations")); complain (_("multiple %%header_extension declarations"));
fscanf (finput, "%s", buff); fscanf (finput, "%s", buff);
printf("-> %s\n", buff); header_extension = xstrdup (buff);
len = strlen (buff);
buff[len] = '\0';
src_extension = XMALLOC (char, len + 1);
stpcpy (header_extension, buff);
} }
/*------------------------------------------. /*------------------------------------------.
@@ -902,16 +897,11 @@ static void
parse_source_extension_decl (void) parse_source_extension_decl (void)
{ {
char buff[32]; char buff[32];
int len;
if (src_extension) if (src_extension)
complain (_("multiple %%source_extension declarations")); complain (_("multiple %%source_extension declarations"));
fscanf (finput, "%s", buff); fscanf (finput, "%s", buff);
printf("-> %s\n", buff); src_extension = xstrdup (buff);
len = strlen (buff);
buff[len] = '\0';
src_extension = XMALLOC (char, len + 1);
stpcpy (src_extension, buff);
} }
/*----------------------------------------------------------------. /*----------------------------------------------------------------.

493
src/vcg.c
View File

@@ -22,6 +22,7 @@
#include "vcg.h" #include "vcg.h"
#include "vcg_defaults.h" #include "vcg_defaults.h"
#include "xalloc.h" #include "xalloc.h"
#include "complain.h"
/* Initialize a graph with the default values. */ /* Initialize a graph with the default values. */
void void
@@ -29,15 +30,15 @@ new_graph (graph_t *g)
{ {
g->title = G_TITLE; g->title = G_TITLE;
g->label = G_LABEL; g->label = G_LABEL;
g->infos[0] = G_INFOS1; g->infos[0] = G_INFOS1;
g->infos[1] = G_INFOS2; g->infos[1] = G_INFOS2;
g->infos[2] = G_INFOS3; g->infos[2] = G_INFOS3;
g->color = G_COLOR; g->color = G_COLOR;
g->textcolor = G_TEXTCOLOR; g->textcolor = G_TEXTCOLOR;
g->bordercolor = G_BORDERCOLOR; g->bordercolor = G_BORDERCOLOR;
g->width = G_WIDTH; g->width = G_WIDTH;
g->height = G_HEIGHT; g->height = G_HEIGHT;
g->borderwidth = G_BORDERWIDTH; g->borderwidth = G_BORDERWIDTH;
@@ -49,17 +50,17 @@ new_graph (graph_t *g)
g->textmode = G_TEXTMODE; g->textmode = G_TEXTMODE;
g->shape = G_SHAPE; g->shape = G_SHAPE;
g->xmax = G_XMAX; /* Not output. */ g->xmax = G_XMAX; /* Not output. */
g->ymax = G_YMAX; /* Not output. */ g->ymax = G_YMAX; /* Not output. */
g->xbase = G_XBASE; g->xbase = G_XBASE;
g->ybase = G_YBASE; g->ybase = G_YBASE;
g->xspace = G_XSPACE; g->xspace = G_XSPACE;
g->yspace = G_YSPACE; g->yspace = G_YSPACE;
g->xlspace = G_XLSPACE; /* Not output. */ g->xlspace = G_XLSPACE; /* Not output. */
g->xraster = G_XRASTER; g->xraster = G_XRASTER;
g->yraster = G_YRASTER; g->yraster = G_YRASTER;
g->xlraster = G_XLRASTER; g->xlraster = G_XLRASTER;
@@ -67,13 +68,13 @@ new_graph (graph_t *g)
g->hidden = G_HIDDEN; /* No default value. */ g->hidden = G_HIDDEN; /* No default value. */
g->classname = G_CLASSNAME; /* No class name association. */ g->classname = G_CLASSNAME; /* No class name association. */
g->layoutalgorithm = G_LAYOUTALGORITHM; g->layoutalgorithm = G_LAYOUTALGORITHM;
g->layout_downfactor = G_LAYOUT_DOWNFACTOR; g->layout_downfactor = G_LAYOUT_DOWNFACTOR;
g->layout_upfactor = G_LAYOUT_UPFACTOR; g->layout_upfactor = G_LAYOUT_UPFACTOR;
g->layout_nearfactor = G_LAYOUT_NEARFACTOR; g->layout_nearfactor = G_LAYOUT_NEARFACTOR;
g->layout_splinefactor = G_LAYOUT_SPLINEFACTOR; g->layout_splinefactor = G_LAYOUT_SPLINEFACTOR;
g->late_edge_labels = G_LATE_EDGE_LABELS; g->late_edge_labels = G_LATE_EDGE_LABELS;
g->display_edge_labels = G_DISPLAY_EDGE_LABELS; g->display_edge_labels = G_DISPLAY_EDGE_LABELS;
g->dirty_edge_labels = G_DIRTY_EDGE_LABELS; g->dirty_edge_labels = G_DIRTY_EDGE_LABELS;
@@ -84,7 +85,7 @@ new_graph (graph_t *g)
g->manhattan_edges = G_MANHATTAN_EDGES; g->manhattan_edges = G_MANHATTAN_EDGES;
g->smanhattan_edges = G_SMANHATTAN_EDGES; g->smanhattan_edges = G_SMANHATTAN_EDGES;
g->near_edges = G_NEAR_EDGES; g->near_edges = G_NEAR_EDGES;
g->orientation = G_ORIENTATION; g->orientation = G_ORIENTATION;
g->node_alignement = G_NODE_ALIGNEMENT; g->node_alignement = G_NODE_ALIGNEMENT;
g->port_sharing = G_PORT_SHARING; g->port_sharing = G_PORT_SHARING;
@@ -108,10 +109,10 @@ new_graph (graph_t *g)
g->rmin = G_RMIN; g->rmin = G_RMIN;
g->rmax = G_RMAX; g->rmax = G_RMAX;
g->smax = G_SMAX; g->smax = G_SMAX;
g->node_list = G_NODE_LIST; g->node_list = G_NODE_LIST;
g->edge_list = G_EDGE_LIST; g->edge_list = G_EDGE_LIST;
new_edge(&g->edge); new_edge(&g->edge);
new_node(&g->node); new_node(&g->node);
} }
@@ -122,33 +123,33 @@ new_node (node_t *node)
{ {
node->title = N_TITLE; node->title = N_TITLE;
node->label = N_LABEL; node->label = N_LABEL;
node->locx = N_LOCX; /* Default unspcified. */ node->locx = N_LOCX; /* Default unspcified. */
node->locy = N_LOCY; /* Default unspcified. */ node->locy = N_LOCY; /* Default unspcified. */
node->vertical_order = N_VERTICAL_ORDER; /* Default unspcified. */ node->vertical_order = N_VERTICAL_ORDER; /* Default unspcified. */
node->horizontal_order = N_HORIZONTAL_ORDER; /* Default unspcified. */ node->horizontal_order = N_HORIZONTAL_ORDER; /* Default unspcified. */
node->width = N_WIDTH; /* We assume that we can't define it now. */ node->width = N_WIDTH; /* We assume that we can't define it now. */
node->height = N_HEIGHT; /* Also. */ node->height = N_HEIGHT; /* Also. */
node->shrink = N_SHRINK; node->shrink = N_SHRINK;
node->stretch = N_STRETCH; node->stretch = N_STRETCH;
node->folding = N_FOLDING; /* No explicit default value. */ node->folding = N_FOLDING; /* No explicit default value. */
node->shape = N_SHAPE; node->shape = N_SHAPE;
node->textmode = N_TEXTMODE; node->textmode = N_TEXTMODE;
node->borderwidth = N_BORDERWIDTH; node->borderwidth = N_BORDERWIDTH;
node->color = N_COLOR; node->color = N_COLOR;
node->textcolor = N_TEXTCOLOR; node->textcolor = N_TEXTCOLOR;
node->bordercolor = N_BORDERCOLOR; node->bordercolor = N_BORDERCOLOR;
node->infos[0] = N_INFOS1; node->infos[0] = N_INFOS1;
node->infos[1] = N_INFOS2; node->infos[1] = N_INFOS2;
node->infos[2] = N_INFOS3; node->infos[2] = N_INFOS3;
node->next = N_NEXT; node->next = N_NEXT;
} }
@@ -197,41 +198,41 @@ get_color_str (enum color_e c)
{ {
switch (c) switch (c)
{ {
case white: return ("white"); case white: return "white";
case blue: return ("blue"); case blue: return "blue";
case red: return ("red"); case red: return "red";
case green: return ("green"); case green: return "green";
case yellow: return ("yellow"); case yellow: return "yellow";
case magenta: return ("magenta"); case magenta: return "magenta";
case cyan: return ("cyan"); case cyan: return "cyan";
case darkgrey: return ("darkgrey"); case darkgrey: return "darkgrey";
case darkblue: return ("darkblue"); case darkblue: return "darkblue";
case darkred: return ("darkred"); case darkred: return "darkred";
case darkgreen: return ("darkgreen"); case darkgreen: return "darkgreen";
case darkyellow: return ("darkyellow"); case darkyellow: return "darkyellow";
case darkmagenta: return ("darkmagenta"); case darkmagenta: return "darkmagenta";
case darkcyan: return ("darkcyan"); case darkcyan: return "darkcyan";
case gold: return ("gold"); case gold: return "gold";
case lightgrey: return ("lightgrey"); case lightgrey: return "lightgrey";
case lightblue: return ("lightblue"); case lightblue: return "lightblue";
case lightred: return ("lightred"); case lightred: return "lightred";
case lightgreen: return ("lightgreen"); case lightgreen: return "lightgreen";
case lightyellow: return ("lightyellow"); case lightyellow: return "lightyellow";
case lightmagenta: return ("lightmagenta"); case lightmagenta: return "lightmagenta";
case lightcyan: return ("lightcyan"); case lightcyan: return "lightcyan";
case lilac: return ("lilac"); case lilac: return "lilac";
case turquoise: return ("turquoise"); case turquoise: return "turquoise";
case aquamarine: return ("aquamarine"); case aquamarine: return "aquamarine";
case khaki: return ("khaki"); case khaki: return "khaki";
case purple: return ("purple"); case purple: return "purple";
case yellowgreen: return ("yellowgreen"); case yellowgreen: return "yellowgreen";
case pink: return ("pink"); case pink: return "pink";
case orange: return ("orange"); case orange: return "orange";
case orchid: return ("orchid"); case orchid: return "orchid";
case black: return ("black"); case black: return "black";
default: default:
complain (_("vcg graph: no such a color.")); complain (_("vcg graph: no such a color."));
return (get_color_str(G_COLOR)); return get_color_str(G_COLOR);
} }
return NULL; return NULL;
} }
@@ -241,12 +242,12 @@ get_textmode_str (enum textmode_e t)
{ {
switch (t) switch (t)
{ {
case centered: return ("center"); case centered: return "center";
case left_justify: return ("left_justify"); case left_justify: return "left_justify";
case right_justify: return ("right_justify"); case right_justify: return "right_justify";
default: default:
complain (_("vcg graph: no such a text mode..")); complain (_("vcg graph: no such a text mode.."));
return (get_textmode_str(G_TEXTMODE)); return get_textmode_str(G_TEXTMODE);
} }
return NULL; return NULL;
} }
@@ -256,13 +257,13 @@ get_shape_str (enum shape_e s)
{ {
switch (s) switch (s)
{ {
case box: return ("box"); case box: return "box";
case rhomb: return ("rhomb"); case rhomb: return "rhomb";
case ellipse: return ("ellipse"); case ellipse: return "ellipse";
case triangle: return ("triangle"); case triangle: return "triangle";
default: default:
complain (_("vcg graph: no such a shape..")); complain (_("vcg graph: no such a shape.."));
return (get_shape_str(G_SHAPE)); return get_shape_str(G_SHAPE);
} }
return NULL; return NULL;
} }
@@ -272,22 +273,22 @@ get_layoutalgorithm_str (enum layoutalgorithm_e l)
{ {
switch (l) switch (l)
{ {
case normal: return ("normal"); case normal: return "normal";
case maxdepth: return ("maxdepth"); case maxdepth: return "maxdepth";
case mindepth: return ("mindepth"); case mindepth: return "mindepth";
case maxdepthslow: return ("maxdepthslow"); case maxdepthslow: return "maxdepthslow";
case mindepthslow: return ("mindepthslow"); case mindepthslow: return "mindepthslow";
case maxdegree: return ("maxdegree"); case maxdegree: return "maxdegree";
case mindegree: return ("mindegree"); case mindegree: return "mindegree";
case maxindegree: return ("maxindegree"); case maxindegree: return "maxindegree";
case minindegree: return ("minindegree"); case minindegree: return "minindegree";
case maxoutdegree: return ("maxoutdegree"); case maxoutdegree: return "maxoutdegree";
case minoutdegree: return ("minoutdegree"); case minoutdegree: return "minoutdegree";
case minbackward: return ("minbackward"); case minbackward: return "minbackward";
case dfs: return ("dfs"); case dfs: return "dfs";
case tree: return ("tree"); case tree: return "tree";
default: default:
return ("normal"); return "normal";
} }
return NULL; return NULL;
} }
@@ -297,11 +298,11 @@ get_decision_str (enum decision_e d, enum decision_e defaults)
{ {
switch (d) switch (d)
{ {
case no: return ("no"); case no: return "no";
case yes: return ("yes"); case yes: return "yes";
default: default:
complain (_("vcg graph: no such a decision..")); complain (_("vcg graph: no such a decision.."));
return (get_decision_str(defaults, 0)); return get_decision_str(defaults, 0);
} }
return NULL; return NULL;
} }
@@ -311,13 +312,13 @@ get_orientation_str (enum orientation_e o)
{ {
switch (o) switch (o)
{ {
case top_to_bottom: return ("top_to_bottom"); case top_to_bottom: return "top_to_bottom";
case bottom_to_top: return ("bottom_to_top"); case bottom_to_top: return "bottom_to_top";
case left_to_right: return ("left_to_right"); case left_to_right: return "left_to_right";
case right_to_left: return ("right_to_left"); case right_to_left: return "right_to_left";
default: default:
complain (_("vcg graph: no such an orientation..")); complain (_("vcg graph: no such an orientation.."));
return (get_orientation_str(G_ORIENTATION)); return get_orientation_str(G_ORIENTATION);
} }
return NULL; return NULL;
} }
@@ -327,12 +328,12 @@ get_node_alignement_str (enum alignement_e a)
{ {
switch (a) switch (a)
{ {
case center: return ("center"); case center: return "center";
case top: return ("top"); case top: return "top";
case bottom: return ("bottom"); case bottom: return "bottom";
default: default:
complain (_("vcg graph: no such an alignement..")); complain (_("vcg graph: no such an alignement.."));
return (get_node_alignement_str(G_NODE_ALIGNEMENT)); return get_node_alignement_str(G_NODE_ALIGNEMENT);
} }
return NULL; return NULL;
} }
@@ -342,11 +343,11 @@ get_arrow_mode_str (enum arrow_mode_e a)
{ {
switch (a) switch (a)
{ {
case fixed: return ("fixed"); case fixed: return "fixed";
case free_a: return ("free"); case free_a: return "free";
default: default:
complain (_("vcg graph: no such an arrow mode..")); complain (_("vcg graph: no such an arrow mode.."));
return (get_arrow_mode_str(G_ARROW_MODE)); return get_arrow_mode_str(G_ARROW_MODE);
} }
return NULL; return NULL;
} }
@@ -356,14 +357,14 @@ get_crossing_type_str (enum crossing_type_e c)
{ {
switch (c) switch (c)
{ {
case bary: return ("bary"); case bary: return "bary";
case median: return ("median"); case median: return "median";
case barymedian: return ("barymedian"); case barymedian: return "barymedian";
case medianbary: return ("medianbary"); case medianbary: return "medianbary";
default: default:
complain (_("vcg graph: no such a crossing_type..")); complain (_("vcg graph: no such a crossing_type.."));
return (get_crossing_type_str(G_CROSSING_WEIGHT)); return get_crossing_type_str(G_CROSSING_WEIGHT);
} }
return NULL; return NULL;
} }
@@ -372,14 +373,14 @@ get_view_str (enum view_e v)
{ {
switch (v) switch (v)
{ {
case normal_view: return ("normal_view"); case normal_view: return "normal_view";
case cfish: return ("cfish"); case cfish: return "cfish";
case pfish: return ("pfish"); case pfish: return "pfish";
case fcfish: return ("fcfish"); case fcfish: return "fcfish";
case fpfish: return ("fpfish"); case fpfish: return "fpfish";
default: default:
complain (_("vcg graph: no such a view..")); complain (_("vcg graph: no such a view.."));
return (get_view_str(G_VIEW)); return get_view_str(G_VIEW);
} }
return NULL; return NULL;
} }
@@ -389,14 +390,14 @@ get_linestyle_str (enum linestyle_e l)
{ {
switch (l) switch (l)
{ {
case continuous: return ("continuous"); case continuous: return "continuous";
case dashed: return ("dashed"); case dashed: return "dashed";
case dotted: return ("dotted"); case dotted: return "dotted";
case invisible: return ("invisible"); case invisible: return "invisible";
default: default:
complain (_("vcg graph: no such a linestyle..")); complain (_("vcg graph: no such a linestyle.."));
return (get_linestyle_str(E_LINESTYLE)); return get_linestyle_str(E_LINESTYLE);
} }
return NULL; return NULL;
} }
@@ -405,12 +406,12 @@ get_arrowstyle_str (enum arrowstyle_e a)
{ {
switch (a) switch (a)
{ {
case solid: return ("solid"); case solid: return "solid";
case line: return ("line"); case line: return "line";
case none: return ("none"); case none: return "none";
default: default:
complain (_("vcg graph: no such an arrowstyle..")); complain (_("vcg graph: no such an arrowstyle.."));
return (get_arrowstyle_str(E_ARROWSTYLE)); return get_arrowstyle_str(E_ARROWSTYLE);
} }
return NULL; return NULL;
} }
@@ -454,16 +455,16 @@ open_edge(edge_t *edge, struct obstack *os)
break; break;
case bent_near_edge: case bent_near_edge:
obstack_sgrow (os, "\tbentnearedge: {\n"); obstack_sgrow (os, "\tbentnearedge: {\n");
break; break;
default: default:
obstack_sgrow (os, "\tedge: {\n"); obstack_sgrow (os, "\tedge: {\n");
} }
} }
void void
close_edge(struct obstack *os) close_edge(struct obstack *os)
{ {
obstack_sgrow (os, "\t}\n"); obstack_sgrow (os, "\t}\n");
} }
void void
@@ -474,7 +475,7 @@ open_node(struct obstack *os)
void void
close_node(struct obstack *os) close_node(struct obstack *os)
{ {
obstack_sgrow (os, "\t}\n"); obstack_sgrow (os, "\t}\n");
} }
@@ -491,7 +492,7 @@ close_graph(graph_t *graph, struct obstack *os)
{ {
node_t *node; node_t *node;
for (node = graph->node_list; node; node = node->next) for (node = graph->node_list; node; node = node->next)
{ {
open_node (os); open_node (os);
@@ -499,23 +500,23 @@ close_graph(graph_t *graph, struct obstack *os)
close_node (os); close_node (os);
} }
} }
obstack_1grow (os, '\n'); obstack_1grow (os, '\n');
{ {
edge_t *edge; edge_t *edge;
for (edge = graph->edge_list; edge; edge = edge->next) for (edge = graph->edge_list; edge; edge = edge->next)
{ {
open_edge (edge, os); open_edge (edge, os);
output_edge (edge, os); output_edge (edge, os);
close_edge (os); close_edge (os);
} }
} }
obstack_sgrow (os, "}\n"); obstack_sgrow (os, "}\n");
} }
/*-------------------------------------------. /*-------------------------------------------.
| Output functions (formatted) in obstack os | | Output functions (formatted) in obstack os |
`-------------------------------------------*/ `-------------------------------------------*/
@@ -530,44 +531,44 @@ output_node (node_t *node, struct obstack *os)
if ((node->locx != N_LOCX) && (node->locy != N_LOCY)) if ((node->locx != N_LOCX) && (node->locy != N_LOCY))
obstack_fgrow2 (os, "\t\tloc { x: %d y: %d }\t\n", node->locx, node->locy); obstack_fgrow2 (os, "\t\tloc { x: %d y: %d }\t\n", node->locx, node->locy);
if (node->vertical_order != N_VERTICAL_ORDER) if (node->vertical_order != N_VERTICAL_ORDER)
obstack_fgrow1 (os, "\t\tvertical_order:\t%d\n", node->vertical_order); obstack_fgrow1 (os, "\t\tvertical_order:\t%d\n", node->vertical_order);
if (node->horizontal_order != N_HORIZONTAL_ORDER) if (node->horizontal_order != N_HORIZONTAL_ORDER)
obstack_fgrow1 (os, "\t\thorizontal_order:\t%d\n", node->horizontal_order); obstack_fgrow1 (os, "\t\thorizontal_order:\t%d\n", node->horizontal_order);
if (node->width != N_WIDTH) if (node->width != N_WIDTH)
obstack_fgrow1 (os, "\t\twidth:\t%d\n", node->width); obstack_fgrow1 (os, "\t\twidth:\t%d\n", node->width);
if (node->height != N_HEIGHT) if (node->height != N_HEIGHT)
obstack_fgrow1 (os, "\t\theight:\t%d\n", node->height); obstack_fgrow1 (os, "\t\theight:\t%d\n", node->height);
if (node->shrink != N_SHRINK) if (node->shrink != N_SHRINK)
obstack_fgrow1 (os, "\t\tshrink:\t%d\n", node->shrink); obstack_fgrow1 (os, "\t\tshrink:\t%d\n", node->shrink);
if (node->stretch != N_STRETCH) if (node->stretch != N_STRETCH)
obstack_fgrow1 (os, "\t\tshrink:\t%d\n", node->shrink); obstack_fgrow1 (os, "\t\tshrink:\t%d\n", node->shrink);
if (node->folding != N_FOLDING) if (node->folding != N_FOLDING)
obstack_fgrow1 (os, "\t\tfolding:\t%d\n", node->folding); obstack_fgrow1 (os, "\t\tfolding:\t%d\n", node->folding);
if (node->textmode != N_TEXTMODE) if (node->textmode != N_TEXTMODE)
obstack_fgrow1 (os, "\t\ttextmode:\t%s\n", obstack_fgrow1 (os, "\t\ttextmode:\t%s\n",
get_textmode_str (node->textmode)); get_textmode_str (node->textmode));
if (node->shape != N_SHAPE) if (node->shape != N_SHAPE)
obstack_fgrow1 (os, "\t\tshape:\t%s\n", get_shape_str (node->shape)); obstack_fgrow1 (os, "\t\tshape:\t%s\n", get_shape_str (node->shape));
if (node->borderwidth != N_BORDERWIDTH) if (node->borderwidth != N_BORDERWIDTH)
obstack_fgrow1 (os, "\t\tborderwidth:\t%d\n", node->borderwidth); obstack_fgrow1 (os, "\t\tborderwidth:\t%d\n", node->borderwidth);
if (node->color != N_COLOR) if (node->color != N_COLOR)
obstack_fgrow1 (os, "\t\tcolor:\t%s\n", get_color_str (node->color)); obstack_fgrow1 (os, "\t\tcolor:\t%s\n", get_color_str (node->color));
if (node->textcolor != N_TEXTCOLOR) if (node->textcolor != N_TEXTCOLOR)
obstack_fgrow1 (os, "\t\ttextcolor:\t%s\n", obstack_fgrow1 (os, "\t\ttextcolor:\t%s\n",
get_color_str (node->textcolor)); get_color_str (node->textcolor));
if (node->bordercolor != N_BORDERCOLOR) if (node->bordercolor != N_BORDERCOLOR)
obstack_fgrow1 (os, "\t\tbordercolor:\t%s\n", obstack_fgrow1 (os, "\t\tbordercolor:\t%s\n",
get_color_str (node->bordercolor)); get_color_str (node->bordercolor));
if (node->infos[0]) if (node->infos[0])
obstack_fgrow1 (os, "\t\tinfo1:\t\"%s\"\n", node->infos[0]); obstack_fgrow1 (os, "\t\tinfo1:\t\"%s\"\n", node->infos[0]);
if (node->infos[1]) if (node->infos[1])
@@ -584,14 +585,14 @@ output_edge (edge_t *edge, struct obstack *os)
obstack_fgrow1 (os, "\t\tsourcename:\t\"%s\"\n", edge->sourcename); obstack_fgrow1 (os, "\t\tsourcename:\t\"%s\"\n", edge->sourcename);
if (edge->targetname != E_TARGETNAME) if (edge->targetname != E_TARGETNAME)
obstack_fgrow1 (os, "\t\ttargetname:\t\"%s\"\n", edge->targetname); obstack_fgrow1 (os, "\t\ttargetname:\t\"%s\"\n", edge->targetname);
if (edge->label != E_LABEL) if (edge->label != E_LABEL)
obstack_fgrow1 (os, "\t\tlabel:\t\"%s\"\n", edge->label); obstack_fgrow1 (os, "\t\tlabel:\t\"%s\"\n", edge->label);
if (edge->linestyle != E_LINESTYLE) if (edge->linestyle != E_LINESTYLE)
obstack_fgrow1 (os, "\t\tlinestyle:\t\"%s\"\n", obstack_fgrow1 (os, "\t\tlinestyle:\t\"%s\"\n",
get_linestyle_str(edge->linestyle)); get_linestyle_str(edge->linestyle));
if (edge->thickness != E_THICKNESS) if (edge->thickness != E_THICKNESS)
obstack_fgrow1 (os, "\t\tthickness:\t%d\n", edge->thickness); obstack_fgrow1 (os, "\t\tthickness:\t%d\n", edge->thickness);
if (edge->class != E_CLASS) if (edge->class != E_CLASS)
@@ -600,27 +601,27 @@ output_edge (edge_t *edge, struct obstack *os)
if (edge->color != E_COLOR) if (edge->color != E_COLOR)
obstack_fgrow1 (os, "\t\tcolor:\t%s\n", get_color_str (edge->color)); obstack_fgrow1 (os, "\t\tcolor:\t%s\n", get_color_str (edge->color));
if (edge->color != E_TEXTCOLOR) if (edge->color != E_TEXTCOLOR)
obstack_fgrow1 (os, "\t\ttextcolor:\t%s\n", obstack_fgrow1 (os, "\t\ttextcolor:\t%s\n",
get_color_str (edge->textcolor)); get_color_str (edge->textcolor));
if (edge->arrowcolor != E_ARROWCOLOR) if (edge->arrowcolor != E_ARROWCOLOR)
obstack_fgrow1 (os, "\t\tarrowcolor:\t%s\n", obstack_fgrow1 (os, "\t\tarrowcolor:\t%s\n",
get_color_str (edge->arrowcolor)); get_color_str (edge->arrowcolor));
if (edge->backarrowcolor != E_BACKARROWCOLOR) if (edge->backarrowcolor != E_BACKARROWCOLOR)
obstack_fgrow1 (os, "\t\tbackarrowcolor:\t%s\n", obstack_fgrow1 (os, "\t\tbackarrowcolor:\t%s\n",
get_color_str (edge->backarrowcolor)); get_color_str (edge->backarrowcolor));
if (edge->arrowsize != E_ARROWSIZE) if (edge->arrowsize != E_ARROWSIZE)
obstack_fgrow1 (os, "\t\tarrowsize:\t%d\n", edge->arrowsize); obstack_fgrow1 (os, "\t\tarrowsize:\t%d\n", edge->arrowsize);
if (edge->backarrowsize != E_BACKARROWSIZE) if (edge->backarrowsize != E_BACKARROWSIZE)
obstack_fgrow1 (os, "\t\tbackarrowsize:\t%d\n", edge->backarrowsize); obstack_fgrow1 (os, "\t\tbackarrowsize:\t%d\n", edge->backarrowsize);
if (edge->arrowstyle != E_ARROWSTYLE) if (edge->arrowstyle != E_ARROWSTYLE)
obstack_fgrow1 (os, "\t\tarrowstyle:\t%s\n", obstack_fgrow1 (os, "\t\tarrowstyle:\t%s\n",
get_arrowstyle_str(edge->arrowstyle)); get_arrowstyle_str(edge->arrowstyle));
if (edge->backarrowstyle != E_BACKARROWSTYLE) if (edge->backarrowstyle != E_BACKARROWSTYLE)
obstack_fgrow1 (os, "\t\tbackarrowstyle:\t%s\n", obstack_fgrow1 (os, "\t\tbackarrowstyle:\t%s\n",
get_arrowstyle_str(edge->backarrowstyle)); get_arrowstyle_str(edge->backarrowstyle));
if (edge->priority != E_PRIORITY) if (edge->priority != E_PRIORITY)
obstack_fgrow1 (os, "\t\tpriority:\t%d\n", edge->priority); obstack_fgrow1 (os, "\t\tpriority:\t%d\n", edge->priority);
if (edge->anchor != E_ANCHOR) if (edge->anchor != E_ANCHOR)
@@ -636,29 +637,29 @@ output_graph (graph_t *graph, struct obstack *os)
obstack_fgrow1 (os, "\ttitle:\t\"%s\"\n", graph->title); obstack_fgrow1 (os, "\ttitle:\t\"%s\"\n", graph->title);
if (graph->label) if (graph->label)
obstack_fgrow1 (os, "\tlabel:\t\"%s\"\n", graph->label); obstack_fgrow1 (os, "\tlabel:\t\"%s\"\n", graph->label);
if (graph->infos[0]) if (graph->infos[0])
obstack_fgrow1 (os, "\tinfo1:\t\"%s\"\n", graph->infos[0]); obstack_fgrow1 (os, "\tinfo1:\t\"%s\"\n", graph->infos[0]);
if (graph->infos[1]) if (graph->infos[1])
obstack_fgrow1 (os, "\tinfo2:\t\"%s\"\n", graph->infos[1]); obstack_fgrow1 (os, "\tinfo2:\t\"%s\"\n", graph->infos[1]);
if (graph->infos[2]) if (graph->infos[2])
obstack_fgrow1 (os, "\tinfo3:\t\"%s\"\n", graph->infos[2]); obstack_fgrow1 (os, "\tinfo3:\t\"%s\"\n", graph->infos[2]);
if (graph->color != G_COLOR) if (graph->color != G_COLOR)
obstack_fgrow1 (os, "\tcolor:\t%s\n", get_color_str (graph->color)); obstack_fgrow1 (os, "\tcolor:\t%s\n", get_color_str (graph->color));
if (graph->textcolor != G_TEXTCOLOR) if (graph->textcolor != G_TEXTCOLOR)
obstack_fgrow1 (os, "\ttextcolor:\t%s\n", get_color_str (graph->textcolor)); obstack_fgrow1 (os, "\ttextcolor:\t%s\n", get_color_str (graph->textcolor));
if (graph->bordercolor != G_BORDERCOLOR) if (graph->bordercolor != G_BORDERCOLOR)
obstack_fgrow1 (os, "\tbordercolor:\t%s\n", obstack_fgrow1 (os, "\tbordercolor:\t%s\n",
get_color_str (graph->bordercolor)); get_color_str (graph->bordercolor));
if (graph->width != G_WIDTH) if (graph->width != G_WIDTH)
obstack_fgrow1 (os, "\twidth:\t%d\n", graph->width); obstack_fgrow1 (os, "\twidth:\t%d\n", graph->width);
if (graph->height != G_HEIGHT) if (graph->height != G_HEIGHT)
obstack_fgrow1 (os, "\theight:\t%d\n", graph->height); obstack_fgrow1 (os, "\theight:\t%d\n", graph->height);
if (graph->borderwidth != G_BORDERWIDTH) if (graph->borderwidth != G_BORDERWIDTH)
obstack_fgrow1 (os, "\tborderwidth:\t%d\n", graph->borderwidth); obstack_fgrow1 (os, "\tborderwidth:\t%d\n", graph->borderwidth);
if (graph->x != G_X) if (graph->x != G_X)
obstack_fgrow1 (os, "\tx:\t%d\n", graph->x); obstack_fgrow1 (os, "\tx:\t%d\n", graph->x);
if (graph->y != G_Y) if (graph->y != G_Y)
@@ -671,19 +672,19 @@ output_graph (graph_t *graph, struct obstack *os)
obstack_fgrow1 (os, "\tshrink:\t%d\n", graph->shrink); obstack_fgrow1 (os, "\tshrink:\t%d\n", graph->shrink);
if (graph->stretch != G_STRETCH) if (graph->stretch != G_STRETCH)
obstack_fgrow1 (os, "\tstretch:\t%d\n", graph->stretch); obstack_fgrow1 (os, "\tstretch:\t%d\n", graph->stretch);
if (graph->textmode != G_TEXTMODE) if (graph->textmode != G_TEXTMODE)
obstack_fgrow1 (os, "\ttextmode:\t%s\n", obstack_fgrow1 (os, "\ttextmode:\t%s\n",
get_textmode_str (graph->textmode)); get_textmode_str (graph->textmode));
if (graph->shape != G_SHAPE) if (graph->shape != G_SHAPE)
obstack_fgrow1 (os, "\tshape:\t%s\n", get_shape_str (graph->shape)); obstack_fgrow1 (os, "\tshape:\t%s\n", get_shape_str (graph->shape));
if (graph->xmax != G_XMAX) if (graph->xmax != G_XMAX)
obstack_fgrow1 (os, "\txmax:\t%d\n", graph->xmax); obstack_fgrow1 (os, "\txmax:\t%d\n", graph->xmax);
if (graph->ymax != G_YMAX) if (graph->ymax != G_YMAX)
obstack_fgrow1 (os, "\tymax:\t%d\n", graph->ymax); obstack_fgrow1 (os, "\tymax:\t%d\n", graph->ymax);
if (graph->xbase != G_XBASE) if (graph->xbase != G_XBASE)
obstack_fgrow1 (os, "\txbase:\t%d\n", graph->xbase); obstack_fgrow1 (os, "\txbase:\t%d\n", graph->xbase);
if (graph->ybase != G_YBASE) if (graph->ybase != G_YBASE)
@@ -695,7 +696,7 @@ output_graph (graph_t *graph, struct obstack *os)
obstack_fgrow1 (os, "\tyspace:\t%d\n", graph->yspace); obstack_fgrow1 (os, "\tyspace:\t%d\n", graph->yspace);
if (graph->xlspace != G_XLSPACE) if (graph->xlspace != G_XLSPACE)
obstack_fgrow1 (os, "\txlspace:\t%d\n", graph->xlspace); obstack_fgrow1 (os, "\txlspace:\t%d\n", graph->xlspace);
if (graph->xraster != G_XRASTER) if (graph->xraster != G_XRASTER)
obstack_fgrow1 (os, "\txraster:\t%d\n", graph->xraster); obstack_fgrow1 (os, "\txraster:\t%d\n", graph->xraster);
if (graph->yraster != G_YRASTER) if (graph->yraster != G_YRASTER)
@@ -705,182 +706,130 @@ output_graph (graph_t *graph, struct obstack *os)
if (graph->hidden != G_HIDDEN) if (graph->hidden != G_HIDDEN)
obstack_fgrow1 (os, "\thidden:\t%d\n", graph->hidden); obstack_fgrow1 (os, "\thidden:\t%d\n", graph->hidden);
if (graph->classname != G_CLASSNAME) if (graph->classname != G_CLASSNAME)
{ {
struct classname_s *ite; struct classname_s *ite;
for (ite = graph->classname; ite; ite = ite->next) for (ite = graph->classname; ite; ite = ite->next)
obstack_fgrow2 (os, "\tclassname %d :\t%s\n", ite->no, ite->name); obstack_fgrow2 (os, "\tclassname %d :\t%s\n", ite->no, ite->name);
} }
if (graph->layoutalgorithm != G_LAYOUTALGORITHM) if (graph->layoutalgorithm != G_LAYOUTALGORITHM)
obstack_fgrow1 (os, "\tlayoutalgorithm:\t%s\n", obstack_fgrow1 (os, "\tlayoutalgorithm:\t%s\n",
get_layoutalgorithm_str(graph->layoutalgorithm)); get_layoutalgorithm_str(graph->layoutalgorithm));
if (graph->layout_downfactor != G_LAYOUT_DOWNFACTOR) if (graph->layout_downfactor != G_LAYOUT_DOWNFACTOR)
obstack_fgrow1 (os, "\tlayout_downfactor:\t%d\n", graph->layout_downfactor); obstack_fgrow1 (os, "\tlayout_downfactor:\t%d\n", graph->layout_downfactor);
if (graph->layout_upfactor != G_LAYOUT_UPFACTOR) if (graph->layout_upfactor != G_LAYOUT_UPFACTOR)
obstack_fgrow1 (os, "\tlayout_upfactor:\t%d\n", graph->layout_upfactor); obstack_fgrow1 (os, "\tlayout_upfactor:\t%d\n", graph->layout_upfactor);
if (graph->layout_nearfactor != G_LAYOUT_NEARFACTOR) if (graph->layout_nearfactor != G_LAYOUT_NEARFACTOR)
obstack_fgrow1 (os, "\tlayout_nearfactor:\t%d\n", graph->layout_nearfactor); obstack_fgrow1 (os, "\tlayout_nearfactor:\t%d\n", graph->layout_nearfactor);
if (graph->layout_splinefactor != G_LAYOUT_SPLINEFACTOR) if (graph->layout_splinefactor != G_LAYOUT_SPLINEFACTOR)
obstack_fgrow1 (os, "\tlayout_splinefactor:\t%d\n", obstack_fgrow1 (os, "\tlayout_splinefactor:\t%d\n",
graph->layout_splinefactor); graph->layout_splinefactor);
if (graph->late_edge_labels != G_LATE_EDGE_LABELS) if (graph->late_edge_labels != G_LATE_EDGE_LABELS)
obstack_fgrow1 (os, "\tlate_edge_labels:\t%s\n", obstack_fgrow1 (os, "\tlate_edge_labels:\t%s\n",
get_decision_str(graph->late_edge_labels, get_decision_str(graph->late_edge_labels,
G_LATE_EDGE_LABELS)); G_LATE_EDGE_LABELS));
if (graph->display_edge_labels != G_DISPLAY_EDGE_LABELS) if (graph->display_edge_labels != G_DISPLAY_EDGE_LABELS)
obstack_fgrow1 (os, "\tdisplay_edge_labels:\t%s\n", obstack_fgrow1 (os, "\tdisplay_edge_labels:\t%s\n",
get_decision_str(graph->display_edge_labels, get_decision_str(graph->display_edge_labels,
G_DISPLAY_EDGE_LABELS)); G_DISPLAY_EDGE_LABELS));
if (graph->dirty_edge_labels != G_DIRTY_EDGE_LABELS) if (graph->dirty_edge_labels != G_DIRTY_EDGE_LABELS)
obstack_fgrow1 (os, "\tdirty_edge_labels:\t%s\n", obstack_fgrow1 (os, "\tdirty_edge_labels:\t%s\n",
get_decision_str(graph->dirty_edge_labels, get_decision_str(graph->dirty_edge_labels,
G_DIRTY_EDGE_LABELS)); G_DIRTY_EDGE_LABELS));
if (graph->finetuning != G_FINETUNING) if (graph->finetuning != G_FINETUNING)
obstack_fgrow1 (os, "\tfinetuning:\t%s\n", obstack_fgrow1 (os, "\tfinetuning:\t%s\n",
get_decision_str(graph->finetuning, G_FINETUNING)); get_decision_str(graph->finetuning, G_FINETUNING));
if (graph->ignore_singles != G_IGNORE_SINGLES) if (graph->ignore_singles != G_IGNORE_SINGLES)
obstack_fgrow1 (os, "\tignore_singles:\t%s\n", obstack_fgrow1 (os, "\tignore_singles:\t%s\n",
get_decision_str(graph->ignore_singles, G_IGNORE_SINGLES)); get_decision_str(graph->ignore_singles, G_IGNORE_SINGLES));
if (graph->straight_phase != G_STRAIGHT_PHASE) if (graph->straight_phase != G_STRAIGHT_PHASE)
obstack_fgrow1 (os, "\tstraight_phase:\t%s\n", obstack_fgrow1 (os, "\tstraight_phase:\t%s\n",
get_decision_str(graph->straight_phase, G_STRAIGHT_PHASE)); get_decision_str(graph->straight_phase, G_STRAIGHT_PHASE));
if (graph->priority_phase != G_PRIORITY_PHASE) if (graph->priority_phase != G_PRIORITY_PHASE)
obstack_fgrow1 (os, "\tpriority_phase:\t%s\n", obstack_fgrow1 (os, "\tpriority_phase:\t%s\n",
get_decision_str(graph->priority_phase, G_PRIORITY_PHASE)); get_decision_str(graph->priority_phase, G_PRIORITY_PHASE));
if (graph->manhattan_edges != G_MANHATTAN_EDGES) if (graph->manhattan_edges != G_MANHATTAN_EDGES)
obstack_fgrow1 (os, obstack_fgrow1 (os,
"\tmanhattan_edges:\t%s\n", "\tmanhattan_edges:\t%s\n",
get_decision_str(graph->manhattan_edges, get_decision_str(graph->manhattan_edges,
G_MANHATTAN_EDGES)); G_MANHATTAN_EDGES));
if (graph->smanhattan_edges != G_SMANHATTAN_EDGES) if (graph->smanhattan_edges != G_SMANHATTAN_EDGES)
obstack_fgrow1 (os, obstack_fgrow1 (os,
"\tsmanhattan_edges:\t%s\n", "\tsmanhattan_edges:\t%s\n",
get_decision_str(graph->smanhattan_edges, get_decision_str(graph->smanhattan_edges,
G_SMANHATTAN_EDGES)); G_SMANHATTAN_EDGES));
if (graph->near_edges != G_NEAR_EDGES) if (graph->near_edges != G_NEAR_EDGES)
obstack_fgrow1 (os, "\tnear_edges:\t%s\n", obstack_fgrow1 (os, "\tnear_edges:\t%s\n",
get_decision_str(graph->near_edges, G_NEAR_EDGES)); get_decision_str(graph->near_edges, G_NEAR_EDGES));
if (graph->orientation != G_ORIENTATION) if (graph->orientation != G_ORIENTATION)
obstack_fgrow1 (os, "\torientation:\t%s\n", obstack_fgrow1 (os, "\torientation:\t%s\n",
get_decision_str(graph->orientation, G_ORIENTATION)); get_decision_str(graph->orientation, G_ORIENTATION));
if (graph->node_alignement != G_NODE_ALIGNEMENT) if (graph->node_alignement != G_NODE_ALIGNEMENT)
obstack_fgrow1 (os, "\tnode_alignement:\t%s\n", obstack_fgrow1 (os, "\tnode_alignement:\t%s\n",
get_decision_str(graph->node_alignement, get_decision_str(graph->node_alignement,
G_NODE_ALIGNEMENT)); G_NODE_ALIGNEMENT));
if (graph->port_sharing != G_PORT_SHARING) if (graph->port_sharing != G_PORT_SHARING)
obstack_fgrow1 (os, "\tport_sharing:\t%s\n", obstack_fgrow1 (os, "\tport_sharing:\t%s\n",
get_decision_str(graph->port_sharing, G_PORT_SHARING)); get_decision_str(graph->port_sharing, G_PORT_SHARING));
if (graph->arrow_mode != G_ARROW_MODE) if (graph->arrow_mode != G_ARROW_MODE)
obstack_fgrow1 (os, "\tarrow_mode:\t%s\n", obstack_fgrow1 (os, "\tarrow_mode:\t%s\n",
get_arrow_mode_str(graph->arrow_mode)); get_arrow_mode_str(graph->arrow_mode));
if (graph->treefactor != G_TREEFACTOR) if (graph->treefactor != G_TREEFACTOR)
obstack_fgrow1 (os, "\ttreefactor:\t%f\n", graph->treefactor); obstack_fgrow1 (os, "\ttreefactor:\t%f\n", graph->treefactor);
if (graph->spreadlevel != G_SPREADLEVEL) if (graph->spreadlevel != G_SPREADLEVEL)
obstack_fgrow1 (os, "\tspreadlevel:\t%d\n", graph->spreadlevel); obstack_fgrow1 (os, "\tspreadlevel:\t%d\n", graph->spreadlevel);
if (graph->crossing_weight != G_CROSSING_WEIGHT) if (graph->crossing_weight != G_CROSSING_WEIGHT)
obstack_fgrow1 (os, "\tcrossing_weight:\t%s\n", obstack_fgrow1 (os, "\tcrossing_weight:\t%s\n",
get_crossing_type_str(graph->crossing_weight)); get_crossing_type_str(graph->crossing_weight));
if (graph->crossing_phase2 != G_CROSSING_PHASE2) if (graph->crossing_phase2 != G_CROSSING_PHASE2)
obstack_fgrow1 (os, "\tcrossing_phase2:\t%s\n", obstack_fgrow1 (os, "\tcrossing_phase2:\t%s\n",
get_decision_str(graph->crossing_phase2, get_decision_str(graph->crossing_phase2,
G_CROSSING_PHASE2)); G_CROSSING_PHASE2));
if (graph->crossing_optimization != G_CROSSING_OPTIMIZATION) if (graph->crossing_optimization != G_CROSSING_OPTIMIZATION)
obstack_fgrow1 (os, "\tcrossing_optimization:\t%s\n", obstack_fgrow1 (os, "\tcrossing_optimization:\t%s\n",
get_decision_str(graph->crossing_optimization, get_decision_str(graph->crossing_optimization,
G_CROSSING_OPTIMIZATION)); G_CROSSING_OPTIMIZATION));
if (graph->view != G_VIEW) if (graph->view != G_VIEW)
obstack_fgrow1 (os, "\tview:\t%s\n", get_view_str(graph->view)); obstack_fgrow1 (os, "\tview:\t%s\n", get_view_str(graph->view));
if (graph->edges != G_EDGES) if (graph->edges != G_EDGES)
obstack_fgrow1 (os, "\tedges:\t%s\n", get_decision_str(graph->edges, obstack_fgrow1 (os, "\tedges:\t%s\n", get_decision_str(graph->edges,
G_EDGES)); G_EDGES));
if (graph->nodes != G_NODES) if (graph->nodes != G_NODES)
obstack_fgrow1 (os,"\tnodes:\t%s\n", obstack_fgrow1 (os,"\tnodes:\t%s\n",
get_decision_str(graph->nodes, G_NODES)); get_decision_str(graph->nodes, G_NODES));
if (graph->splines != G_SPLINES) if (graph->splines != G_SPLINES)
obstack_fgrow1 (os, "\tsplines:\t%s\n", obstack_fgrow1 (os, "\tsplines:\t%s\n",
get_decision_str(graph->splines, G_SPLINES)); get_decision_str(graph->splines, G_SPLINES));
if (graph->bmax != G_BMAX) if (graph->bmax != G_BMAX)
obstack_fgrow1 (os, "\tbmax:\t%d\n", graph->bmax); obstack_fgrow1 (os, "\tbmax:\t%d\n", graph->bmax);
if (graph->cmin != G_CMIN) if (graph->cmin != G_CMIN)
obstack_fgrow1 (os, "\tcmin:\t%d\n", graph->cmin); obstack_fgrow1 (os, "\tcmin:\t%d\n", graph->cmin);
if (graph->cmax != G_CMAX) if (graph->cmax != G_CMAX)
obstack_fgrow1 (os, "\tcmax:\t%d\n", graph->cmax); obstack_fgrow1 (os, "\tcmax:\t%d\n", graph->cmax);
if (graph->pmin != G_PMIN) if (graph->pmin != G_PMIN)
obstack_fgrow1 (os, "\tpmin:\t%d\n", graph->pmin); obstack_fgrow1 (os, "\tpmin:\t%d\n", graph->pmin);
if (graph->pmax != G_PMAX) if (graph->pmax != G_PMAX)
obstack_fgrow1 (os, "\tpmax:\t%d\n", graph->pmax); obstack_fgrow1 (os, "\tpmax:\t%d\n", graph->pmax);
if (graph->rmin != G_RMIN) if (graph->rmin != G_RMIN)
obstack_fgrow1 (os, "\trmin:\t%d\n", graph->rmin); obstack_fgrow1 (os, "\trmin:\t%d\n", graph->rmin);
if (graph->rmax != G_RMAX) if (graph->rmax != G_RMAX)
obstack_fgrow1 (os, "\trmax:\t%d\n", graph->rmax); obstack_fgrow1 (os, "\trmax:\t%d\n", graph->rmax);
if (graph->smax != G_SMAX) if (graph->smax != G_SMAX)
obstack_fgrow1 (os, "\tsmax:\t%d\n", graph->smax); obstack_fgrow1 (os, "\tsmax:\t%d\n", graph->smax);
} }
#ifdef NDEBUG
int main ()
{
graph_t graph;
node_t *node;
edge_t *edge;
struct obstack graph_obstack;
obstack_init (&graph_obstack);
new_graph(&graph);
graph.title = "graph_title";
graph.label = "graph_label";
graph.color = yellow;
graph.textcolor = green;
graph.width = 5;
graph.x = 12;
graph.y = 17;
graph.textmode = right_justify;
open_graph (&graph, stdout);
node = XMALLOC (node_t, 1);
new_node (node);
node->title = "A";
node->locx = 12;
node->locy = 71;
add_node (&graph, node);
node = XMALLOC (node_t, 1);
new_node (node);
node->title = "B";
add_node (&graph, node);
edge = XMALLOC (edge_t, 1);
new_edge (edge);
edge->sourcename = "B";
edge->targetname = "A";
add_edge (&graph, edge);
output_graph(&graph, stdout);
close_graph (&graph, stdout);
obstack_save (&graph_obstack, "essai.vcg");
return (0);
}
#endif /* not DEBUG */