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