]> git.saurik.com Git - bison.git/blob - src/vcg.c
* src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
[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\tstretch:\t%d\n", node->stretch);
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 /* FIXME: SOURCENAME and TARGETNAME are mandatory
584 so it has to be fatal not to give these informations. */
585 if (edge->sourcename != E_SOURCENAME)
586 obstack_fgrow1 (os, "\t\tsourcename:\t\"%s\"\n", edge->sourcename);
587 if (edge->targetname != E_TARGETNAME)
588 obstack_fgrow1 (os, "\t\ttargetname:\t\"%s\"\n", edge->targetname);
589
590 if (edge->label != E_LABEL)
591 obstack_fgrow1 (os, "\t\tlabel:\t\"%s\"\n", edge->label);
592
593 if (edge->linestyle != E_LINESTYLE)
594 obstack_fgrow1 (os, "\t\tlinestyle:\t\"%s\"\n",
595 get_linestyle_str(edge->linestyle));
596
597 if (edge->thickness != E_THICKNESS)
598 obstack_fgrow1 (os, "\t\tthickness:\t%d\n", edge->thickness);
599 if (edge->class != E_CLASS)
600 obstack_fgrow1 (os, "\t\tclass:\t%d\n", edge->class);
601
602 if (edge->color != E_COLOR)
603 obstack_fgrow1 (os, "\t\tcolor:\t%s\n", get_color_str (edge->color));
604 if (edge->color != E_TEXTCOLOR)
605 obstack_fgrow1 (os, "\t\ttextcolor:\t%s\n",
606 get_color_str (edge->textcolor));
607 if (edge->arrowcolor != E_ARROWCOLOR)
608 obstack_fgrow1 (os, "\t\tarrowcolor:\t%s\n",
609 get_color_str (edge->arrowcolor));
610 if (edge->backarrowcolor != E_BACKARROWCOLOR)
611 obstack_fgrow1 (os, "\t\tbackarrowcolor:\t%s\n",
612 get_color_str (edge->backarrowcolor));
613
614 if (edge->arrowsize != E_ARROWSIZE)
615 obstack_fgrow1 (os, "\t\tarrowsize:\t%d\n", edge->arrowsize);
616 if (edge->backarrowsize != E_BACKARROWSIZE)
617 obstack_fgrow1 (os, "\t\tbackarrowsize:\t%d\n", edge->backarrowsize);
618
619 if (edge->arrowstyle != E_ARROWSTYLE)
620 obstack_fgrow1 (os, "\t\tarrowstyle:\t%s\n",
621 get_arrowstyle_str(edge->arrowstyle));
622 if (edge->backarrowstyle != E_BACKARROWSTYLE)
623 obstack_fgrow1 (os, "\t\tbackarrowstyle:\t%s\n",
624 get_arrowstyle_str(edge->backarrowstyle));
625
626 if (edge->priority != E_PRIORITY)
627 obstack_fgrow1 (os, "\t\tpriority:\t%d\n", edge->priority);
628 if (edge->anchor != E_ANCHOR)
629 obstack_fgrow1 (os, "\t\tanchor:\t%d\n", edge->anchor);
630 if (edge->horizontal_order != E_HORIZONTAL_ORDER)
631 obstack_fgrow1 (os, "\t\thorizontal_order:\t%d\n", edge->horizontal_order);
632 }
633
634 void
635 output_graph (graph_t *graph, struct obstack *os)
636 {
637 if (graph->title)
638 obstack_fgrow1 (os, "\ttitle:\t\"%s\"\n", graph->title);
639 if (graph->label)
640 obstack_fgrow1 (os, "\tlabel:\t\"%s\"\n", graph->label);
641
642 if (graph->infos[0])
643 obstack_fgrow1 (os, "\tinfo1:\t\"%s\"\n", graph->infos[0]);
644 if (graph->infos[1])
645 obstack_fgrow1 (os, "\tinfo2:\t\"%s\"\n", graph->infos[1]);
646 if (graph->infos[2])
647 obstack_fgrow1 (os, "\tinfo3:\t\"%s\"\n", graph->infos[2]);
648
649 if (graph->color != G_COLOR)
650 obstack_fgrow1 (os, "\tcolor:\t%s\n", get_color_str (graph->color));
651 if (graph->textcolor != G_TEXTCOLOR)
652 obstack_fgrow1 (os, "\ttextcolor:\t%s\n", get_color_str (graph->textcolor));
653 if (graph->bordercolor != G_BORDERCOLOR)
654 obstack_fgrow1 (os, "\tbordercolor:\t%s\n",
655 get_color_str (graph->bordercolor));
656
657 if (graph->width != G_WIDTH)
658 obstack_fgrow1 (os, "\twidth:\t%d\n", graph->width);
659 if (graph->height != G_HEIGHT)
660 obstack_fgrow1 (os, "\theight:\t%d\n", graph->height);
661 if (graph->borderwidth != G_BORDERWIDTH)
662 obstack_fgrow1 (os, "\tborderwidth:\t%d\n", graph->borderwidth);
663
664 if (graph->x != G_X)
665 obstack_fgrow1 (os, "\tx:\t%d\n", graph->x);
666 if (graph->y != G_Y)
667 obstack_fgrow1 (os, "\ty:\t%d\n", graph->y);
668
669 if (graph->folding != G_FOLDING)
670 obstack_fgrow1 (os, "\tfolding:\t%d\n", graph->folding);
671
672 if (graph->shrink != G_SHRINK)
673 obstack_fgrow1 (os, "\tshrink:\t%d\n", graph->shrink);
674 if (graph->stretch != G_STRETCH)
675 obstack_fgrow1 (os, "\tstretch:\t%d\n", graph->stretch);
676
677 if (graph->textmode != G_TEXTMODE)
678 obstack_fgrow1 (os, "\ttextmode:\t%s\n",
679 get_textmode_str (graph->textmode));
680
681 if (graph->shape != G_SHAPE)
682 obstack_fgrow1 (os, "\tshape:\t%s\n", get_shape_str (graph->shape));
683
684 if (graph->xmax != G_XMAX)
685 obstack_fgrow1 (os, "\txmax:\t%d\n", graph->xmax);
686 if (graph->ymax != G_YMAX)
687 obstack_fgrow1 (os, "\tymax:\t%d\n", graph->ymax);
688
689 if (graph->xbase != G_XBASE)
690 obstack_fgrow1 (os, "\txbase:\t%d\n", graph->xbase);
691 if (graph->ybase != G_YBASE)
692 obstack_fgrow1 (os, "\tybase:\t%d\n", graph->ybase);
693
694 if (graph->xspace != G_XSPACE)
695 obstack_fgrow1 (os, "\txspace:\t%d\n", graph->xspace);
696 if (graph->yspace != G_YSPACE)
697 obstack_fgrow1 (os, "\tyspace:\t%d\n", graph->yspace);
698 if (graph->xlspace != G_XLSPACE)
699 obstack_fgrow1 (os, "\txlspace:\t%d\n", graph->xlspace);
700
701 if (graph->xraster != G_XRASTER)
702 obstack_fgrow1 (os, "\txraster:\t%d\n", graph->xraster);
703 if (graph->yraster != G_YRASTER)
704 obstack_fgrow1 (os, "\tyraster:\t%d\n", graph->yraster);
705 if (graph->xlraster != G_XLRASTER)
706 obstack_fgrow1 (os, "\txlraster:\t%d\n", graph->xlraster);
707
708 if (graph->hidden != G_HIDDEN)
709 obstack_fgrow1 (os, "\thidden:\t%d\n", graph->hidden);
710
711 if (graph->classname != G_CLASSNAME)
712 {
713 struct classname_s *ite;
714
715 for (ite = graph->classname; ite; ite = ite->next)
716 obstack_fgrow2 (os, "\tclassname %d :\t%s\n", ite->no, ite->name);
717 }
718
719 if (graph->layoutalgorithm != G_LAYOUTALGORITHM)
720 obstack_fgrow1 (os, "\tlayoutalgorithm:\t%s\n",
721 get_layoutalgorithm_str(graph->layoutalgorithm));
722
723 if (graph->layout_downfactor != G_LAYOUT_DOWNFACTOR)
724 obstack_fgrow1 (os, "\tlayout_downfactor:\t%d\n", graph->layout_downfactor);
725 if (graph->layout_upfactor != G_LAYOUT_UPFACTOR)
726 obstack_fgrow1 (os, "\tlayout_upfactor:\t%d\n", graph->layout_upfactor);
727 if (graph->layout_nearfactor != G_LAYOUT_NEARFACTOR)
728 obstack_fgrow1 (os, "\tlayout_nearfactor:\t%d\n", graph->layout_nearfactor);
729 if (graph->layout_splinefactor != G_LAYOUT_SPLINEFACTOR)
730 obstack_fgrow1 (os, "\tlayout_splinefactor:\t%d\n",
731 graph->layout_splinefactor);
732
733 if (graph->late_edge_labels != G_LATE_EDGE_LABELS)
734 obstack_fgrow1 (os, "\tlate_edge_labels:\t%s\n",
735 get_decision_str(graph->late_edge_labels,
736 G_LATE_EDGE_LABELS));
737 if (graph->display_edge_labels != G_DISPLAY_EDGE_LABELS)
738 obstack_fgrow1 (os, "\tdisplay_edge_labels:\t%s\n",
739 get_decision_str(graph->display_edge_labels,
740 G_DISPLAY_EDGE_LABELS));
741 if (graph->dirty_edge_labels != G_DIRTY_EDGE_LABELS)
742 obstack_fgrow1 (os, "\tdirty_edge_labels:\t%s\n",
743 get_decision_str(graph->dirty_edge_labels,
744 G_DIRTY_EDGE_LABELS));
745 if (graph->finetuning != G_FINETUNING)
746 obstack_fgrow1 (os, "\tfinetuning:\t%s\n",
747 get_decision_str(graph->finetuning, G_FINETUNING));
748 if (graph->ignore_singles != G_IGNORE_SINGLES)
749 obstack_fgrow1 (os, "\tignore_singles:\t%s\n",
750 get_decision_str(graph->ignore_singles, G_IGNORE_SINGLES));
751 if (graph->straight_phase != G_STRAIGHT_PHASE)
752 obstack_fgrow1 (os, "\tstraight_phase:\t%s\n",
753 get_decision_str(graph->straight_phase, G_STRAIGHT_PHASE));
754 if (graph->priority_phase != G_PRIORITY_PHASE)
755 obstack_fgrow1 (os, "\tpriority_phase:\t%s\n",
756 get_decision_str(graph->priority_phase, G_PRIORITY_PHASE));
757 if (graph->manhattan_edges != G_MANHATTAN_EDGES)
758 obstack_fgrow1 (os,
759 "\tmanhattan_edges:\t%s\n",
760 get_decision_str(graph->manhattan_edges,
761 G_MANHATTAN_EDGES));
762 if (graph->smanhattan_edges != G_SMANHATTAN_EDGES)
763 obstack_fgrow1 (os,
764 "\tsmanhattan_edges:\t%s\n",
765 get_decision_str(graph->smanhattan_edges,
766 G_SMANHATTAN_EDGES));
767 if (graph->near_edges != G_NEAR_EDGES)
768 obstack_fgrow1 (os, "\tnear_edges:\t%s\n",
769 get_decision_str(graph->near_edges, G_NEAR_EDGES));
770
771 if (graph->orientation != G_ORIENTATION)
772 obstack_fgrow1 (os, "\torientation:\t%s\n",
773 get_decision_str(graph->orientation, G_ORIENTATION));
774
775 if (graph->node_alignement != G_NODE_ALIGNEMENT)
776 obstack_fgrow1 (os, "\tnode_alignement:\t%s\n",
777 get_decision_str(graph->node_alignement,
778 G_NODE_ALIGNEMENT));
779
780 if (graph->port_sharing != G_PORT_SHARING)
781 obstack_fgrow1 (os, "\tport_sharing:\t%s\n",
782 get_decision_str(graph->port_sharing, G_PORT_SHARING));
783
784 if (graph->arrow_mode != G_ARROW_MODE)
785 obstack_fgrow1 (os, "\tarrow_mode:\t%s\n",
786 get_arrow_mode_str(graph->arrow_mode));
787
788 if (graph->treefactor != G_TREEFACTOR)
789 obstack_fgrow1 (os, "\ttreefactor:\t%f\n", graph->treefactor);
790 if (graph->spreadlevel != G_SPREADLEVEL)
791 obstack_fgrow1 (os, "\tspreadlevel:\t%d\n", graph->spreadlevel);
792
793 if (graph->crossing_weight != G_CROSSING_WEIGHT)
794 obstack_fgrow1 (os, "\tcrossing_weight:\t%s\n",
795 get_crossing_type_str(graph->crossing_weight));
796 if (graph->crossing_phase2 != G_CROSSING_PHASE2)
797 obstack_fgrow1 (os, "\tcrossing_phase2:\t%s\n",
798 get_decision_str(graph->crossing_phase2,
799 G_CROSSING_PHASE2));
800 if (graph->crossing_optimization != G_CROSSING_OPTIMIZATION)
801 obstack_fgrow1 (os, "\tcrossing_optimization:\t%s\n",
802 get_decision_str(graph->crossing_optimization,
803 G_CROSSING_OPTIMIZATION));
804
805 if (graph->view != G_VIEW)
806 obstack_fgrow1 (os, "\tview:\t%s\n", get_view_str(graph->view));
807
808 if (graph->edges != G_EDGES)
809 obstack_fgrow1 (os, "\tedges:\t%s\n", get_decision_str(graph->edges,
810 G_EDGES));
811
812 if (graph->nodes != G_NODES)
813 obstack_fgrow1 (os,"\tnodes:\t%s\n",
814 get_decision_str(graph->nodes, G_NODES));
815
816 if (graph->splines != G_SPLINES)
817 obstack_fgrow1 (os, "\tsplines:\t%s\n",
818 get_decision_str(graph->splines, G_SPLINES));
819
820 if (graph->bmax != G_BMAX)
821 obstack_fgrow1 (os, "\tbmax:\t%d\n", graph->bmax);
822 if (graph->cmin != G_CMIN)
823 obstack_fgrow1 (os, "\tcmin:\t%d\n", graph->cmin);
824 if (graph->cmax != G_CMAX)
825 obstack_fgrow1 (os, "\tcmax:\t%d\n", graph->cmax);
826 if (graph->pmin != G_PMIN)
827 obstack_fgrow1 (os, "\tpmin:\t%d\n", graph->pmin);
828 if (graph->pmax != G_PMAX)
829 obstack_fgrow1 (os, "\tpmax:\t%d\n", graph->pmax);
830 if (graph->rmin != G_RMIN)
831 obstack_fgrow1 (os, "\trmin:\t%d\n", graph->rmin);
832 if (graph->rmax != G_RMAX)
833 obstack_fgrow1 (os, "\trmax:\t%d\n", graph->rmax);
834 if (graph->smax != G_SMAX)
835 obstack_fgrow1 (os, "\tsmax:\t%d\n", graph->smax);
836 }