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