]> git.saurik.com Git - bison.git/blob - src/vcg.c
* src/vcg.h (struct infoname_s): New.
[bison.git] / src / vcg.c
1 /* VCG description handler for Bison.
2 Copyright 2001 Free Software Foundation, Inc.
3
4 This file is part of Bison, the GNU Compiler Compiler.
5
6 Bison is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 Bison is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with Bison; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 #include "system.h"
22 #include "vcg.h"
23 #include "vcg_defaults.h"
24
25 /* Initialize a graph with the default values. */
26 void
27 new_graph (graph_t *g)
28 {
29 g->title = G_TITLE;
30 g->label = G_LABEL;
31
32 g->infos[0] = G_INFOS1;
33 g->infos[1] = G_INFOS2;
34 g->infos[2] = G_INFOS3;
35
36 g->color = G_COLOR;
37 g->textcolor = G_TEXTCOLOR;
38 g->bordercolor = G_BORDERCOLOR;
39
40 g->width = G_WIDTH;
41 g->height = G_HEIGHT;
42 g->borderwidth = G_BORDERWIDTH;
43 g->x = G_X;
44 g->y = G_Y;
45 g->folding = G_FOLDING;
46 g->shrink = G_SHRINK;
47 g->stretch = G_STRETCH;
48
49 g->textmode = G_TEXTMODE;
50 g->shape = G_SHAPE;
51
52 g->vertical_order = G_VERTICAL_ORDER;
53 g->horizontal_order = G_HORIZONTAL_ORDER;
54
55 g->xmax = G_XMAX; /* Not output. */
56 g->ymax = G_YMAX; /* Not output. */
57
58 g->xbase = G_XBASE;
59 g->ybase = G_YBASE;
60
61 g->xspace = G_XSPACE;
62 g->yspace = G_YSPACE;
63 g->xlspace = G_XLSPACE; /* Not output. */
64
65 g->xraster = G_XRASTER;
66 g->yraster = G_YRASTER;
67 g->xlraster = G_XLRASTER;
68
69 g->hidden = G_HIDDEN; /* No default value. */
70
71 g->classname = G_CLASSNAME; /* No class name association. */
72
73 g->layoutalgorithm = G_LAYOUTALGORITHM;
74 g->layout_downfactor = G_LAYOUT_DOWNFACTOR;
75 g->layout_upfactor = G_LAYOUT_UPFACTOR;
76 g->layout_nearfactor = G_LAYOUT_NEARFACTOR;
77 g->layout_splinefactor = G_LAYOUT_SPLINEFACTOR;
78
79 g->late_edge_labels = G_LATE_EDGE_LABELS;
80 g->display_edge_labels = G_DISPLAY_EDGE_LABELS;
81 g->dirty_edge_labels = G_DIRTY_EDGE_LABELS;
82 g->finetuning = G_FINETUNING;
83 g->ignore_singles = G_IGNORE_SINGLES;
84 g->straight_phase = G_STRAIGHT_PHASE;
85 g->priority_phase = G_PRIORITY_PHASE;
86 g->manhattan_edges = G_MANHATTAN_EDGES;
87 g->smanhattan_edges = G_SMANHATTAN_EDGES;
88 g->near_edges = G_NEAR_EDGES;
89
90 g->orientation = G_ORIENTATION;
91 g->node_alignement = G_NODE_ALIGNEMENT;
92 g->port_sharing = G_PORT_SHARING;
93 g->arrow_mode = G_ARROW_MODE;
94 g->treefactor = G_TREEFACTOR;
95 g->spreadlevel = G_SPREADLEVEL;
96 g->crossing_weight = G_CROSSING_WEIGHT;
97 g->crossing_phase2 = G_CROSSING_PHASE2;
98 g->crossing_optimization = G_CROSSING_OPTIMIZATION;
99 g->view = G_VIEW;
100
101 g->edges = G_EDGES;
102 g->nodes = G_NODES;
103 g->splines = G_SPLINES;
104
105 g->bmax = G_BMAX;
106 g->cmin = G_CMIN;
107 g->cmax = G_CMAX;
108 g->pmin = G_PMIN;
109 g->pmax = G_PMAX;
110 g->rmin = G_RMIN;
111 g->rmax = G_RMAX;
112 g->smax = G_SMAX;
113
114 g->node_list = G_NODE_LIST;
115 g->edge_list = G_EDGE_LIST;
116
117 new_edge(&g->edge);
118 new_node(&g->node);
119 }
120
121 /* Initialize a node with the defalut values. */
122 void
123 new_node (node_t *node)
124 {
125 node->title = N_TITLE;
126 node->label = N_LABEL;
127
128 node->locx = N_LOCX; /* Default unspcified. */
129 node->locy = N_LOCY; /* Default unspcified. */
130
131 node->vertical_order = N_VERTICAL_ORDER; /* Default unspcified. */
132 node->horizontal_order = N_HORIZONTAL_ORDER; /* Default unspcified. */
133
134 node->width = N_WIDTH; /* We assume that we can't define it now. */
135 node->height = N_HEIGHT; /* Also. */
136
137 node->shrink = N_SHRINK;
138 node->stretch = N_STRETCH;
139
140 node->folding = N_FOLDING; /* No explicit default value. */
141
142 node->shape = N_SHAPE;
143 node->textmode = N_TEXTMODE;
144 node->borderwidth = N_BORDERWIDTH;
145
146 node->color = N_COLOR;
147 node->textcolor = N_TEXTCOLOR;
148 node->bordercolor = N_BORDERCOLOR;
149
150 node->infos[0] = N_INFOS1;
151 node->infos[1] = N_INFOS2;
152 node->infos[2] = N_INFOS3;
153
154 node->next = N_NEXT;
155 }
156
157 /* Initialize a edge with the defalut values. */
158 void
159 new_edge (edge_t *edge)
160 {
161 edge->type = E_EDGE_TYPE;
162
163 edge->sourcename = E_SOURCENAME;
164 edge->targetname = E_TARGETNAME;
165 edge->label = E_LABEL;
166
167 edge->linestyle = E_LINESTYLE;
168 edge->thickness = E_THICKNESS;
169
170 edge->class = E_CLASS;
171
172 edge->color = E_COLOR;
173 edge->textcolor = E_TEXTCOLOR;
174 edge->arrowcolor = E_ARROWCOLOR;
175 edge->backarrowcolor = E_BACKARROWCOLOR;
176
177 edge->arrowsize = E_ARROWSIZE;
178 edge->backarrowsize = E_BACKARROWSIZE;
179 edge->arrowstyle = E_ARROWSTYLE;
180
181 edge->backarrowstyle = E_BACKARROWSTYLE;
182
183 edge->priority = E_PRIORITY;
184
185 edge->anchor = E_ANCHOR;
186
187 edge->horizontal_order = E_HORIZONTAL_ORDER;
188
189 edge->next = E_NEXT;
190 }
191
192 /*----------------------------------------------.
193 | Get functions. |
194 | Return string corresponding to an enum value. |
195 `----------------------------------------------*/
196
197 static const char *
198 get_color_str (enum color_e c)
199 {
200 switch (c)
201 {
202 case white: return "white";
203 case blue: return "blue";
204 case red: return "red";
205 case green: return "green";
206 case yellow: return "yellow";
207 case magenta: return "magenta";
208 case cyan: return "cyan";
209 case darkgrey: return "darkgrey";
210 case darkblue: return "darkblue";
211 case darkred: return "darkred";
212 case darkgreen: return "darkgreen";
213 case darkyellow: return "darkyellow";
214 case darkmagenta: return "darkmagenta";
215 case darkcyan: return "darkcyan";
216 case gold: return "gold";
217 case lightgrey: return "lightgrey";
218 case lightblue: return "lightblue";
219 case lightred: return "lightred";
220 case lightgreen: return "lightgreen";
221 case lightyellow: return "lightyellow";
222 case lightmagenta: return "lightmagenta";
223 case lightcyan: return "lightcyan";
224 case lilac: return "lilac";
225 case turquoise: return "turquoise";
226 case aquamarine: return "aquamarine";
227 case khaki: return "khaki";
228 case purple: return "purple";
229 case yellowgreen: return "yellowgreen";
230 case pink: return "pink";
231 case orange: return "orange";
232 case orchid: return "orchid";
233 case black: return "black";
234 default:
235 assert (!"Not a default color.");
236 }
237 return NULL;
238 }
239
240 static const char *
241 get_textmode_str (enum textmode_e t)
242 {
243 switch (t)
244 {
245 case centered: return "center";
246 case left_justify: return "left_justify";
247 case right_justify: return "right_justify";
248 default:
249 assert (!"Not a text mode.");
250 }
251 return NULL;
252 }
253
254 static const char *
255 get_shape_str (enum shape_e s)
256 {
257 switch (s)
258 {
259 case box: return "box";
260 case rhomb: return "rhomb";
261 case ellipse: return "ellipse";
262 case triangle: return "triangle";
263 default:
264 assert (!"Not a shape.");
265 }
266 return NULL;
267 }
268
269 static const char *
270 get_layoutalgorithm_str (enum layoutalgorithm_e l)
271 {
272 switch (l)
273 {
274 case normal: return "normal";
275 case maxdepth: return "maxdepth";
276 case mindepth: return "mindepth";
277 case maxdepthslow: return "maxdepthslow";
278 case mindepthslow: return "mindepthslow";
279 case maxdegree: return "maxdegree";
280 case mindegree: return "mindegree";
281 case maxindegree: return "maxindegree";
282 case minindegree: return "minindegree";
283 case maxoutdegree: return "maxoutdegree";
284 case minoutdegree: return "minoutdegree";
285 case minbackward: return "minbackward";
286 case dfs: return "dfs";
287 case tree: return "tree";
288 default:
289 assert (!"Not a layout algorithm.");
290 }
291 return NULL;
292 }
293
294 static const char *
295 get_decision_str (enum decision_e d)
296 {
297 switch (d)
298 {
299 case no: return "no";
300 case yes: return "yes";
301 default:
302 assert (!"Either yes nor no.");
303 }
304 return NULL;
305 }
306
307 static const char *
308 get_orientation_str (enum orientation_e o)
309 {
310 switch (o)
311 {
312 case top_to_bottom: return "top_to_bottom";
313 case bottom_to_top: return "bottom_to_top";
314 case left_to_right: return "left_to_right";
315 case right_to_left: return "right_to_left";
316 default:
317 assert (!"Not an orientation.");
318 }
319 return NULL;
320 }
321
322 static const char *
323 get_node_alignement_str (enum alignement_e a)
324 {
325 switch (a)
326 {
327 case center: return "center";
328 case top: return "top";
329 case bottom: return "bottom";
330 default:
331 assert (!"Not an alignement.");
332 }
333 return NULL;
334 }
335
336 static const char *
337 get_arrow_mode_str (enum arrow_mode_e a)
338 {
339 switch (a)
340 {
341 case fixed: return "fixed";
342 case free_a: return "free";
343 default:
344 assert (!"Not an arrow mode.");
345 }
346 return NULL;
347 }
348
349 static const char *
350 get_crossing_type_str (enum crossing_type_e c)
351 {
352 switch (c)
353 {
354 case bary: return "bary";
355 case median: return "median";
356 case barymedian: return "barymedian";
357 case medianbary: return "medianbary";
358 default:
359 assert (!"Not a crossing type.");
360 }
361 return NULL;
362 }
363
364 static const char *
365 get_view_str (enum view_e v)
366 {
367 switch (v)
368 {
369 case normal_view: return "normal_view";
370 case cfish: return "cfish";
371 case pfish: return "pfish";
372 case fcfish: return "fcfish";
373 case fpfish: return "fpfish";
374 default:
375 assert (!"Not a view.");
376 }
377 return NULL;
378 }
379
380 static const char *
381 get_linestyle_str (enum linestyle_e l)
382 {
383 switch (l)
384 {
385 case continuous: return "continuous";
386 case dashed: return "dashed";
387 case dotted: return "dotted";
388 case invisible: return "invisible";
389 default:
390 assert (!"Not a line style.");
391 }
392 return NULL;
393 }
394
395 static const char *
396 get_arrowstyle_str (enum arrowstyle_e a)
397 {
398 switch (a)
399 {
400 case solid: return "solid";
401 case line: return "line";
402 case none: return "none";
403 default:
404 assert (!"Not an arrow style.");
405 }
406 return NULL;
407 }
408
409 /*----------------------------.
410 | Add functions. |
411 | Edge and Nodes int a graph. |
412 `----------------------------*/
413
414 void
415 add_node (graph_t *graph, node_t *node)
416 {
417 node->next = graph->node_list;
418 graph->node_list = node;
419 }
420
421 void
422 add_edge (graph_t *graph, edge_t *edge)
423 {
424 edge->next = graph->edge_list;
425 graph->edge_list = edge;
426 }
427
428 /*-------------------------------------.
429 | Open and close functions (formatted) |
430 `-------------------------------------*/
431
432 void
433 open_edge(edge_t *edge, struct obstack *os)
434 {
435 switch (edge->type)
436 {
437 case normal_edge:
438 obstack_sgrow (os, "\tedge: {\n");
439 break;
440 case back_edge:
441 obstack_sgrow (os, "\tbackedge: {\n");
442 break;
443 case near_edge:
444 obstack_sgrow (os, "\tnearedge: {\n");
445 break;
446 case bent_near_edge:
447 obstack_sgrow (os, "\tbentnearedge: {\n");
448 break;
449 default:
450 obstack_sgrow (os, "\tedge: {\n");
451 }
452 }
453
454 void
455 close_edge(struct obstack *os)
456 {
457 obstack_sgrow (os, "\t}\n");
458 }
459
460 void
461 open_node(struct obstack *os)
462 {
463 obstack_sgrow (os, "\tnode: {\n");
464 }
465
466 void
467 close_node(struct obstack *os)
468 {
469 obstack_sgrow (os, "\t}\n");
470 }
471
472 void
473 open_graph(struct obstack *os)
474 {
475 obstack_sgrow (os, "graph: {\n");
476 }
477
478 void
479 close_graph(graph_t *graph, struct obstack *os)
480 {
481 obstack_1grow (os, '\n');
482
483 {
484 node_t *node;
485
486 for (node = graph->node_list; node; node = node->next)
487 {
488 open_node (os);
489 output_node (node, os);
490 close_node (os);
491 }
492 }
493
494 obstack_1grow (os, '\n');
495
496 {
497 edge_t *edge;
498
499 for (edge = graph->edge_list; edge; edge = edge->next)
500 {
501 open_edge (edge, os);
502 output_edge (edge, os);
503 close_edge (os);
504 }
505 }
506
507 obstack_sgrow (os, "}\n");
508 }
509
510 /*-------------------------------------------.
511 | Output functions (formatted) in obstack os |
512 `-------------------------------------------*/
513
514 void
515 output_node (node_t *node, struct obstack *os)
516 {
517 if (node->title != N_TITLE)
518 obstack_fgrow1 (os, "\t\ttitle:\t\"%s\"\n", node->title);
519 if (node->label != N_LABEL)
520 obstack_fgrow1 (os, "\t\tlabel:\t\"%s\"\n", node->label);
521
522 if ((node->locx != N_LOCX) && (node->locy != N_LOCY))
523 obstack_fgrow2 (os, "\t\tloc { x: %d y: %d }\t\n", node->locx, node->locy);
524
525 if (node->vertical_order != N_VERTICAL_ORDER)
526 obstack_fgrow1 (os, "\t\tvertical_order:\t%d\n", node->vertical_order);
527 if (node->horizontal_order != N_HORIZONTAL_ORDER)
528 obstack_fgrow1 (os, "\t\thorizontal_order:\t%d\n", node->horizontal_order);
529
530 if (node->width != N_WIDTH)
531 obstack_fgrow1 (os, "\t\twidth:\t%d\n", node->width);
532 if (node->height != N_HEIGHT)
533 obstack_fgrow1 (os, "\t\theight:\t%d\n", node->height);
534
535 if (node->shrink != N_SHRINK)
536 obstack_fgrow1 (os, "\t\tshrink:\t%d\n", node->shrink);
537 if (node->stretch != N_STRETCH)
538 obstack_fgrow1 (os, "\t\tstretch:\t%d\n", node->stretch);
539
540 if (node->folding != N_FOLDING)
541 obstack_fgrow1 (os, "\t\tfolding:\t%d\n", node->folding);
542
543 if (node->textmode != N_TEXTMODE)
544 obstack_fgrow1 (os, "\t\ttextmode:\t%s\n",
545 get_textmode_str (node->textmode));
546
547 if (node->shape != N_SHAPE)
548 obstack_fgrow1 (os, "\t\tshape:\t%s\n", get_shape_str (node->shape));
549
550 if (node->borderwidth != N_BORDERWIDTH)
551 obstack_fgrow1 (os, "\t\tborderwidth:\t%d\n", node->borderwidth);
552
553 if (node->color != N_COLOR)
554 obstack_fgrow1 (os, "\t\tcolor:\t%s\n", get_color_str (node->color));
555 if (node->textcolor != N_TEXTCOLOR)
556 obstack_fgrow1 (os, "\t\ttextcolor:\t%s\n",
557 get_color_str (node->textcolor));
558 if (node->bordercolor != N_BORDERCOLOR)
559 obstack_fgrow1 (os, "\t\tbordercolor:\t%s\n",
560 get_color_str (node->bordercolor));
561
562 if (node->infos[0])
563 obstack_fgrow1 (os, "\t\tinfo1:\t\"%s\"\n", node->infos[0]);
564 if (node->infos[1])
565 obstack_fgrow1 (os, "\t\tinfo2:\t\"%s\"\n", node->infos[1]);
566 if (node->infos[2])
567 obstack_fgrow1 (os, "\t\tinfo3:\t\"%s\"\n", node->infos[2]);
568 }
569
570 void
571 output_edge (edge_t *edge, struct obstack *os)
572 {
573 /* FIXME: SOURCENAME and TARGETNAME are mandatory
574 so it has to be fatal not to give these informations. */
575 if (edge->sourcename != E_SOURCENAME)
576 obstack_fgrow1 (os, "\t\tsourcename:\t\"%s\"\n", edge->sourcename);
577 if (edge->targetname != E_TARGETNAME)
578 obstack_fgrow1 (os, "\t\ttargetname:\t\"%s\"\n", edge->targetname);
579
580 if (edge->label != E_LABEL)
581 obstack_fgrow1 (os, "\t\tlabel:\t\"%s\"\n", edge->label);
582
583 if (edge->linestyle != E_LINESTYLE)
584 obstack_fgrow1 (os, "\t\tlinestyle:\t\"%s\"\n",
585 get_linestyle_str(edge->linestyle));
586
587 if (edge->thickness != E_THICKNESS)
588 obstack_fgrow1 (os, "\t\tthickness:\t%d\n", edge->thickness);
589 if (edge->class != E_CLASS)
590 obstack_fgrow1 (os, "\t\tclass:\t%d\n", edge->class);
591
592 if (edge->color != E_COLOR)
593 obstack_fgrow1 (os, "\t\tcolor:\t%s\n", get_color_str (edge->color));
594 if (edge->color != E_TEXTCOLOR)
595 obstack_fgrow1 (os, "\t\ttextcolor:\t%s\n",
596 get_color_str (edge->textcolor));
597 if (edge->arrowcolor != E_ARROWCOLOR)
598 obstack_fgrow1 (os, "\t\tarrowcolor:\t%s\n",
599 get_color_str (edge->arrowcolor));
600 if (edge->backarrowcolor != E_BACKARROWCOLOR)
601 obstack_fgrow1 (os, "\t\tbackarrowcolor:\t%s\n",
602 get_color_str (edge->backarrowcolor));
603
604 if (edge->arrowsize != E_ARROWSIZE)
605 obstack_fgrow1 (os, "\t\tarrowsize:\t%d\n", edge->arrowsize);
606 if (edge->backarrowsize != E_BACKARROWSIZE)
607 obstack_fgrow1 (os, "\t\tbackarrowsize:\t%d\n", edge->backarrowsize);
608
609 if (edge->arrowstyle != E_ARROWSTYLE)
610 obstack_fgrow1 (os, "\t\tarrowstyle:\t%s\n",
611 get_arrowstyle_str(edge->arrowstyle));
612 if (edge->backarrowstyle != E_BACKARROWSTYLE)
613 obstack_fgrow1 (os, "\t\tbackarrowstyle:\t%s\n",
614 get_arrowstyle_str(edge->backarrowstyle));
615
616 if (edge->priority != E_PRIORITY)
617 obstack_fgrow1 (os, "\t\tpriority:\t%d\n", edge->priority);
618 if (edge->anchor != E_ANCHOR)
619 obstack_fgrow1 (os, "\t\tanchor:\t%d\n", edge->anchor);
620 if (edge->horizontal_order != E_HORIZONTAL_ORDER)
621 obstack_fgrow1 (os, "\t\thorizontal_order:\t%d\n", edge->horizontal_order);
622 }
623
624 void
625 output_graph (graph_t *graph, struct obstack *os)
626 {
627 if (graph->title)
628 obstack_fgrow1 (os, "\ttitle:\t\"%s\"\n", graph->title);
629 if (graph->label)
630 obstack_fgrow1 (os, "\tlabel:\t\"%s\"\n", graph->label);
631
632 if (graph->infos[0])
633 obstack_fgrow1 (os, "\tinfo1:\t\"%s\"\n", graph->infos[0]);
634 if (graph->infos[1])
635 obstack_fgrow1 (os, "\tinfo2:\t\"%s\"\n", graph->infos[1]);
636 if (graph->infos[2])
637 obstack_fgrow1 (os, "\tinfo3:\t\"%s\"\n", graph->infos[2]);
638
639 if (graph->color != G_COLOR)
640 obstack_fgrow1 (os, "\tcolor:\t%s\n", get_color_str (graph->color));
641 if (graph->textcolor != G_TEXTCOLOR)
642 obstack_fgrow1 (os, "\ttextcolor:\t%s\n", get_color_str (graph->textcolor));
643 if (graph->bordercolor != G_BORDERCOLOR)
644 obstack_fgrow1 (os, "\tbordercolor:\t%s\n",
645 get_color_str (graph->bordercolor));
646
647 if (graph->width != G_WIDTH)
648 obstack_fgrow1 (os, "\twidth:\t%d\n", graph->width);
649 if (graph->height != G_HEIGHT)
650 obstack_fgrow1 (os, "\theight:\t%d\n", graph->height);
651 if (graph->borderwidth != G_BORDERWIDTH)
652 obstack_fgrow1 (os, "\tborderwidth:\t%d\n", graph->borderwidth);
653
654 if (graph->x != G_X)
655 obstack_fgrow1 (os, "\tx:\t%d\n", graph->x);
656 if (graph->y != G_Y)
657 obstack_fgrow1 (os, "\ty:\t%d\n", graph->y);
658
659 if (graph->folding != G_FOLDING)
660 obstack_fgrow1 (os, "\tfolding:\t%d\n", graph->folding);
661
662 if (graph->shrink != G_SHRINK)
663 obstack_fgrow1 (os, "\tshrink:\t%d\n", graph->shrink);
664 if (graph->stretch != G_STRETCH)
665 obstack_fgrow1 (os, "\tstretch:\t%d\n", graph->stretch);
666
667 if (graph->textmode != G_TEXTMODE)
668 obstack_fgrow1 (os, "\ttextmode:\t%s\n",
669 get_textmode_str (graph->textmode));
670
671 if (graph->shape != G_SHAPE)
672 obstack_fgrow1 (os, "\tshape:\t%s\n", get_shape_str (graph->shape));
673
674 if (graph->vertical_order != G_VERTICAL_ORDER)
675 obstack_fgrow1 (os, "\tvertical_order:\t%d\n", graph->vertical_order);
676 if (graph->horizontal_order != G_HORIZONTAL_ORDER)
677 obstack_fgrow1 (os, "\thorizontal_order:\t%d\n", graph->horizontal_order);
678
679 if (graph->xmax != G_XMAX)
680 obstack_fgrow1 (os, "\txmax:\t%d\n", graph->xmax);
681 if (graph->ymax != G_YMAX)
682 obstack_fgrow1 (os, "\tymax:\t%d\n", graph->ymax);
683
684 if (graph->xbase != G_XBASE)
685 obstack_fgrow1 (os, "\txbase:\t%d\n", graph->xbase);
686 if (graph->ybase != G_YBASE)
687 obstack_fgrow1 (os, "\tybase:\t%d\n", graph->ybase);
688
689 if (graph->xspace != G_XSPACE)
690 obstack_fgrow1 (os, "\txspace:\t%d\n", graph->xspace);
691 if (graph->yspace != G_YSPACE)
692 obstack_fgrow1 (os, "\tyspace:\t%d\n", graph->yspace);
693 if (graph->xlspace != G_XLSPACE)
694 obstack_fgrow1 (os, "\txlspace:\t%d\n", graph->xlspace);
695
696 if (graph->xraster != G_XRASTER)
697 obstack_fgrow1 (os, "\txraster:\t%d\n", graph->xraster);
698 if (graph->yraster != G_YRASTER)
699 obstack_fgrow1 (os, "\tyraster:\t%d\n", graph->yraster);
700 if (graph->xlraster != G_XLRASTER)
701 obstack_fgrow1 (os, "\txlraster:\t%d\n", graph->xlraster);
702
703 if (graph->hidden != G_HIDDEN)
704 obstack_fgrow1 (os, "\thidden:\t%d\n", graph->hidden);
705
706 if (graph->classname != G_CLASSNAME)
707 {
708 struct classname_s *ite;
709
710 for (ite = graph->classname; ite; ite = ite->next)
711 obstack_fgrow2 (os, "\tclassname %d :\t%s\n", ite->no, ite->name);
712 }
713
714 if (graph->infoname != G_INFONAME)
715 {
716 struct infoname_s *ite;
717
718 for (ite = graph->infoname; ite; ite = ite->next)
719 obstack_fgrow2 (os, "\tinfoname %d :\t%s\n", ite->integer, ite->string);
720 }
721
722 if (graph->colorentry != G_COLORENTRY)
723 {
724 struct colorentry_s *ite;
725 char buff[64];
726
727 for (ite = graph->colorentry; ite; ite = ite->next)
728 {
729 sprintf (buff, "\tcolorentry %d :\t%d %d %d\n",
730 ite->color_index,
731 ite->red_cp,
732 ite->green_cp,
733 ite->blue_cp);
734 obstack_sgrow (os, buff);
735 }
736 }
737
738 if (graph->layoutalgorithm != G_LAYOUTALGORITHM)
739 obstack_fgrow1 (os, "\tlayoutalgorithm:\t%s\n",
740 get_layoutalgorithm_str(graph->layoutalgorithm));
741
742 if (graph->layout_downfactor != G_LAYOUT_DOWNFACTOR)
743 obstack_fgrow1 (os, "\tlayout_downfactor:\t%d\n", graph->layout_downfactor);
744 if (graph->layout_upfactor != G_LAYOUT_UPFACTOR)
745 obstack_fgrow1 (os, "\tlayout_upfactor:\t%d\n", graph->layout_upfactor);
746 if (graph->layout_nearfactor != G_LAYOUT_NEARFACTOR)
747 obstack_fgrow1 (os, "\tlayout_nearfactor:\t%d\n", graph->layout_nearfactor);
748 if (graph->layout_splinefactor != G_LAYOUT_SPLINEFACTOR)
749 obstack_fgrow1 (os, "\tlayout_splinefactor:\t%d\n",
750 graph->layout_splinefactor);
751
752 if (graph->late_edge_labels != G_LATE_EDGE_LABELS)
753 obstack_fgrow1 (os, "\tlate_edge_labels:\t%s\n",
754 get_decision_str(graph->late_edge_labels));
755 if (graph->display_edge_labels != G_DISPLAY_EDGE_LABELS)
756 obstack_fgrow1 (os, "\tdisplay_edge_labels:\t%s\n",
757 get_decision_str(graph->display_edge_labels));
758 if (graph->dirty_edge_labels != G_DIRTY_EDGE_LABELS)
759 obstack_fgrow1 (os, "\tdirty_edge_labels:\t%s\n",
760 get_decision_str(graph->dirty_edge_labels));
761 if (graph->finetuning != G_FINETUNING)
762 obstack_fgrow1 (os, "\tfinetuning:\t%s\n",
763 get_decision_str(graph->finetuning));
764 if (graph->ignore_singles != G_IGNORE_SINGLES)
765 obstack_fgrow1 (os, "\tignore_singles:\t%s\n",
766 get_decision_str(graph->ignore_singles));
767 if (graph->straight_phase != G_STRAIGHT_PHASE)
768 obstack_fgrow1 (os, "\tstraight_phase:\t%s\n",
769 get_decision_str(graph->straight_phase));
770 if (graph->priority_phase != G_PRIORITY_PHASE)
771 obstack_fgrow1 (os, "\tpriority_phase:\t%s\n",
772 get_decision_str(graph->priority_phase));
773 if (graph->manhattan_edges != G_MANHATTAN_EDGES)
774 obstack_fgrow1 (os,
775 "\tmanhattan_edges:\t%s\n",
776 get_decision_str(graph->manhattan_edges));
777 if (graph->smanhattan_edges != G_SMANHATTAN_EDGES)
778 obstack_fgrow1 (os,
779 "\tsmanhattan_edges:\t%s\n",
780 get_decision_str(graph->smanhattan_edges));
781 if (graph->near_edges != G_NEAR_EDGES)
782 obstack_fgrow1 (os, "\tnear_edges:\t%s\n",
783 get_decision_str(graph->near_edges));
784
785 if (graph->orientation != G_ORIENTATION)
786 obstack_fgrow1 (os, "\torientation:\t%s\n",
787 get_orientation_str(graph->orientation));
788
789 if (graph->node_alignement != G_NODE_ALIGNEMENT)
790 obstack_fgrow1 (os, "\tnode_alignement:\t%s\n",
791 get_node_alignement_str(graph->node_alignement));
792
793 if (graph->port_sharing != G_PORT_SHARING)
794 obstack_fgrow1 (os, "\tport_sharing:\t%s\n",
795 get_decision_str(graph->port_sharing));
796
797 if (graph->arrow_mode != G_ARROW_MODE)
798 obstack_fgrow1 (os, "\tarrow_mode:\t%s\n",
799 get_arrow_mode_str(graph->arrow_mode));
800
801 if (graph->treefactor != G_TREEFACTOR)
802 obstack_fgrow1 (os, "\ttreefactor:\t%f\n", graph->treefactor);
803 if (graph->spreadlevel != G_SPREADLEVEL)
804 obstack_fgrow1 (os, "\tspreadlevel:\t%d\n", graph->spreadlevel);
805
806 if (graph->crossing_weight != G_CROSSING_WEIGHT)
807 obstack_fgrow1 (os, "\tcrossing_weight:\t%s\n",
808 get_crossing_type_str(graph->crossing_weight));
809 if (graph->crossing_phase2 != G_CROSSING_PHASE2)
810 obstack_fgrow1 (os, "\tcrossing_phase2:\t%s\n",
811 get_decision_str(graph->crossing_phase2));
812 if (graph->crossing_optimization != G_CROSSING_OPTIMIZATION)
813 obstack_fgrow1 (os, "\tcrossing_optimization:\t%s\n",
814 get_decision_str(graph->crossing_optimization));
815
816 if (graph->view != G_VIEW)
817 obstack_fgrow1 (os, "\tview:\t%s\n", get_view_str(graph->view));
818
819 if (graph->edges != G_EDGES)
820 obstack_fgrow1 (os, "\tedges:\t%s\n", get_decision_str(graph->edges));
821
822 if (graph->nodes != G_NODES)
823 obstack_fgrow1 (os,"\tnodes:\t%s\n", get_decision_str(graph->nodes));
824
825 if (graph->splines != G_SPLINES)
826 obstack_fgrow1 (os, "\tsplines:\t%s\n", get_decision_str(graph->splines));
827
828 if (graph->bmax != G_BMAX)
829 obstack_fgrow1 (os, "\tbmax:\t%d\n", graph->bmax);
830 if (graph->cmin != G_CMIN)
831 obstack_fgrow1 (os, "\tcmin:\t%d\n", graph->cmin);
832 if (graph->cmax != G_CMAX)
833 obstack_fgrow1 (os, "\tcmax:\t%d\n", graph->cmax);
834 if (graph->pmin != G_PMIN)
835 obstack_fgrow1 (os, "\tpmin:\t%d\n", graph->pmin);
836 if (graph->pmax != G_PMAX)
837 obstack_fgrow1 (os, "\tpmax:\t%d\n", graph->pmax);
838 if (graph->rmin != G_RMIN)
839 obstack_fgrow1 (os, "\trmin:\t%d\n", graph->rmin);
840 if (graph->rmax != G_RMAX)
841 obstack_fgrow1 (os, "\trmax:\t%d\n", graph->rmax);
842 if (graph->smax != G_SMAX)
843 obstack_fgrow1 (os, "\tsmax:\t%d\n", graph->smax);
844 }