]>
git.saurik.com Git - bison.git/blob - src/vcg.c
1 /* VCG description handler for Bison.
2 Copyright 2001 Free Software Foundation, Inc.
4 This file is part of Bison, the GNU Compiler Compiler.
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)
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.
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. */
24 #include "vcg_defaults.h"
26 /* Initialize a graph with the default values. */
28 new_graph (graph_t
*g
)
33 g
->infos
[0] = G_INFOS1
;
34 g
->infos
[1] = G_INFOS2
;
35 g
->infos
[2] = G_INFOS3
;
38 g
->textcolor
= G_TEXTCOLOR
;
39 g
->bordercolor
= G_BORDERCOLOR
;
43 g
->borderwidth
= G_BORDERWIDTH
;
46 g
->folding
= G_FOLDING
;
48 g
->stretch
= G_STRETCH
;
50 g
->textmode
= G_TEXTMODE
;
53 g
->vertical_order
= G_VERTICAL_ORDER
;
54 g
->horizontal_order
= G_HORIZONTAL_ORDER
;
56 g
->xmax
= G_XMAX
; /* Not output. */
57 g
->ymax
= G_YMAX
; /* Not output. */
64 g
->xlspace
= G_XLSPACE
; /* Not output. */
66 g
->xraster
= G_XRASTER
;
67 g
->yraster
= G_YRASTER
;
68 g
->xlraster
= G_XLRASTER
;
70 g
->hidden
= G_HIDDEN
; /* No default value. */
72 g
->classname
= G_CLASSNAME
; /* No class name association. */
74 g
->layoutalgorithm
= G_LAYOUTALGORITHM
;
75 g
->layout_downfactor
= G_LAYOUT_DOWNFACTOR
;
76 g
->layout_upfactor
= G_LAYOUT_UPFACTOR
;
77 g
->layout_nearfactor
= G_LAYOUT_NEARFACTOR
;
78 g
->layout_splinefactor
= G_LAYOUT_SPLINEFACTOR
;
80 g
->late_edge_labels
= G_LATE_EDGE_LABELS
;
81 g
->display_edge_labels
= G_DISPLAY_EDGE_LABELS
;
82 g
->dirty_edge_labels
= G_DIRTY_EDGE_LABELS
;
83 g
->finetuning
= G_FINETUNING
;
84 g
->ignore_singles
= G_IGNORE_SINGLES
;
85 g
->straight_phase
= G_STRAIGHT_PHASE
;
86 g
->priority_phase
= G_PRIORITY_PHASE
;
87 g
->manhattan_edges
= G_MANHATTAN_EDGES
;
88 g
->smanhattan_edges
= G_SMANHATTAN_EDGES
;
89 g
->near_edges
= G_NEAR_EDGES
;
91 g
->orientation
= G_ORIENTATION
;
92 g
->node_alignement
= G_NODE_ALIGNEMENT
;
93 g
->port_sharing
= G_PORT_SHARING
;
94 g
->arrow_mode
= G_ARROW_MODE
;
95 g
->treefactor
= G_TREEFACTOR
;
96 g
->spreadlevel
= G_SPREADLEVEL
;
97 g
->crossing_weight
= G_CROSSING_WEIGHT
;
98 g
->crossing_phase2
= G_CROSSING_PHASE2
;
99 g
->crossing_optimization
= G_CROSSING_OPTIMIZATION
;
104 g
->splines
= G_SPLINES
;
115 g
->node_list
= G_NODE_LIST
;
116 g
->edge_list
= G_EDGE_LIST
;
122 /* Initialize a node with the defalut values. */
124 new_node (node_t
*node
)
126 node
->title
= N_TITLE
;
127 node
->label
= N_LABEL
;
129 node
->locx
= N_LOCX
; /* Default unspcified. */
130 node
->locy
= N_LOCY
; /* Default unspcified. */
132 node
->vertical_order
= N_VERTICAL_ORDER
; /* Default unspcified. */
133 node
->horizontal_order
= N_HORIZONTAL_ORDER
; /* Default unspcified. */
135 node
->width
= N_WIDTH
; /* We assume that we can't define it now. */
136 node
->height
= N_HEIGHT
; /* Also. */
138 node
->shrink
= N_SHRINK
;
139 node
->stretch
= N_STRETCH
;
141 node
->folding
= N_FOLDING
; /* No explicit default value. */
143 node
->shape
= N_SHAPE
;
144 node
->textmode
= N_TEXTMODE
;
145 node
->borderwidth
= N_BORDERWIDTH
;
147 node
->color
= N_COLOR
;
148 node
->textcolor
= N_TEXTCOLOR
;
149 node
->bordercolor
= N_BORDERCOLOR
;
151 node
->infos
[0] = N_INFOS1
;
152 node
->infos
[1] = N_INFOS2
;
153 node
->infos
[2] = N_INFOS3
;
158 /* Initialize a edge with the defalut values. */
160 new_edge (edge_t
*edge
)
162 edge
->type
= E_EDGE_TYPE
;
164 edge
->sourcename
= E_SOURCENAME
;
165 edge
->targetname
= E_TARGETNAME
;
166 edge
->label
= E_LABEL
;
168 edge
->linestyle
= E_LINESTYLE
;
169 edge
->thickness
= E_THICKNESS
;
171 edge
->class = E_CLASS
;
173 edge
->color
= E_COLOR
;
174 edge
->textcolor
= E_TEXTCOLOR
;
175 edge
->arrowcolor
= E_ARROWCOLOR
;
176 edge
->backarrowcolor
= E_BACKARROWCOLOR
;
178 edge
->arrowsize
= E_ARROWSIZE
;
179 edge
->backarrowsize
= E_BACKARROWSIZE
;
180 edge
->arrowstyle
= E_ARROWSTYLE
;
182 edge
->backarrowstyle
= E_BACKARROWSTYLE
;
184 edge
->priority
= E_PRIORITY
;
186 edge
->anchor
= E_ANCHOR
;
188 edge
->horizontal_order
= E_HORIZONTAL_ORDER
;
193 /*----------------------------------------------.
195 | Return string corresponding to an enum value. |
196 `----------------------------------------------*/
199 get_color_str (enum color_e c
)
203 case white
: return "white";
204 case blue
: return "blue";
205 case red
: return "red";
206 case green
: return "green";
207 case yellow
: return "yellow";
208 case magenta
: return "magenta";
209 case cyan
: return "cyan";
210 case darkgrey
: return "darkgrey";
211 case darkblue
: return "darkblue";
212 case darkred
: return "darkred";
213 case darkgreen
: return "darkgreen";
214 case darkyellow
: return "darkyellow";
215 case darkmagenta
: return "darkmagenta";
216 case darkcyan
: return "darkcyan";
217 case gold
: return "gold";
218 case lightgrey
: return "lightgrey";
219 case lightblue
: return "lightblue";
220 case lightred
: return "lightred";
221 case lightgreen
: return "lightgreen";
222 case lightyellow
: return "lightyellow";
223 case lightmagenta
: return "lightmagenta";
224 case lightcyan
: return "lightcyan";
225 case lilac
: return "lilac";
226 case turquoise
: return "turquoise";
227 case aquamarine
: return "aquamarine";
228 case khaki
: return "khaki";
229 case purple
: return "purple";
230 case yellowgreen
: return "yellowgreen";
231 case pink
: return "pink";
232 case orange
: return "orange";
233 case orchid
: return "orchid";
234 case black
: return "black";
236 assert (!"Not a default color.");
242 get_textmode_str (enum textmode_e t
)
246 case centered
: return "center";
247 case left_justify
: return "left_justify";
248 case right_justify
: return "right_justify";
250 assert (!"Not a text mode.");
256 get_shape_str (enum shape_e s
)
260 case box
: return "box";
261 case rhomb
: return "rhomb";
262 case ellipse
: return "ellipse";
263 case triangle
: return "triangle";
265 assert (!"Not a shape.");
271 get_layoutalgorithm_str (enum layoutalgorithm_e l
)
275 case normal
: return "normal";
276 case maxdepth
: return "maxdepth";
277 case mindepth
: return "mindepth";
278 case maxdepthslow
: return "maxdepthslow";
279 case mindepthslow
: return "mindepthslow";
280 case maxdegree
: return "maxdegree";
281 case mindegree
: return "mindegree";
282 case maxindegree
: return "maxindegree";
283 case minindegree
: return "minindegree";
284 case maxoutdegree
: return "maxoutdegree";
285 case minoutdegree
: return "minoutdegree";
286 case minbackward
: return "minbackward";
287 case dfs
: return "dfs";
288 case tree
: return "tree";
290 assert (!"Not a layout algorithm.");
296 get_decision_str (enum decision_e d
)
300 case no
: return "no";
301 case yes
: return "yes";
303 assert (!"Either yes nor no.");
309 get_orientation_str (enum orientation_e o
)
313 case top_to_bottom
: return "top_to_bottom";
314 case bottom_to_top
: return "bottom_to_top";
315 case left_to_right
: return "left_to_right";
316 case right_to_left
: return "right_to_left";
318 assert (!"Not an orientation.");
324 get_node_alignement_str (enum alignement_e a
)
328 case center
: return "center";
329 case top
: return "top";
330 case bottom
: return "bottom";
332 assert (!"Not an alignement.");
338 get_arrow_mode_str (enum arrow_mode_e a
)
342 case fixed
: return "fixed";
343 case free_a
: return "free";
345 assert (!"Not an arrow mode.");
351 get_crossing_type_str (enum crossing_type_e c
)
355 case bary
: return "bary";
356 case median
: return "median";
357 case barymedian
: return "barymedian";
358 case medianbary
: return "medianbary";
360 assert (!"Not a crossing type.");
366 get_view_str (enum view_e v
)
370 case normal_view
: return "normal_view";
371 case cfish
: return "cfish";
372 case pfish
: return "pfish";
373 case fcfish
: return "fcfish";
374 case fpfish
: return "fpfish";
376 assert (!"Not a view.");
382 get_linestyle_str (enum linestyle_e l
)
386 case continuous
: return "continuous";
387 case dashed
: return "dashed";
388 case dotted
: return "dotted";
389 case invisible
: return "invisible";
391 assert (!"Not a line style.");
397 get_arrowstyle_str (enum arrowstyle_e a
)
401 case solid
: return "solid";
402 case line
: return "line";
403 case none
: return "none";
405 assert (!"Not an arrow style.");
410 /*----------------------------.
412 | Edge and Nodes int a graph. |
413 `----------------------------*/
416 add_node (graph_t
*graph
, node_t
*node
)
418 node
->next
= graph
->node_list
;
419 graph
->node_list
= node
;
423 add_edge (graph_t
*graph
, edge_t
*edge
)
425 edge
->next
= graph
->edge_list
;
426 graph
->edge_list
= edge
;
430 add_classname (graph_t
*g
, int val
, const char *name
)
432 struct classname_s
*classname
;
434 classname
= XMALLOC (struct classname_s
, 1);
436 classname
->name
= name
;
437 classname
->next
= g
->classname
;
438 g
->classname
= classname
;
442 add_infoname (graph_t
*g
, int integer
, const char *string
)
444 struct infoname_s
*infoname
;
446 infoname
= XMALLOC (struct infoname_s
, 1);
447 infoname
->integer
= integer
;
448 infoname
->string
= string
;
449 infoname
->next
= g
->infoname
;
450 g
->infoname
= infoname
;
453 /* Build a colorentry struct and add it to the list. */
455 add_colorentry (graph_t
*g
, int color_idx
, int red_cp
,
456 int green_cp
, int blue_cp
)
458 struct colorentry_s
*ce
;
460 ce
= XMALLOC (struct colorentry_s
, 1);
461 ce
->color_index
= color_idx
;
463 ce
->green_cp
= green_cp
;
464 ce
->blue_cp
= blue_cp
;
465 ce
->next
= g
->colorentry
;
469 /*-------------------------------------.
470 | Open and close functions (formatted) |
471 `-------------------------------------*/
474 open_edge(edge_t
*edge
, struct obstack
*os
)
479 obstack_sgrow (os
, "\tedge: {\n");
482 obstack_sgrow (os
, "\tbackedge: {\n");
485 obstack_sgrow (os
, "\tnearedge: {\n");
488 obstack_sgrow (os
, "\tbentnearedge: {\n");
491 obstack_sgrow (os
, "\tedge: {\n");
496 close_edge(struct obstack
*os
)
498 obstack_sgrow (os
, "\t}\n");
502 open_node(struct obstack
*os
)
504 obstack_sgrow (os
, "\tnode: {\n");
508 close_node(struct obstack
*os
)
510 obstack_sgrow (os
, "\t}\n");
514 open_graph(struct obstack
*os
)
516 obstack_sgrow (os
, "graph: {\n");
520 close_graph(graph_t
*graph
, struct obstack
*os
)
522 obstack_1grow (os
, '\n');
524 /* FIXME: Unallocate nodes and edges if required. */
528 for (node
= graph
->node_list
; node
; node
= node
->next
)
531 output_node (node
, os
);
536 obstack_1grow (os
, '\n');
541 for (edge
= graph
->edge_list
; edge
; edge
= edge
->next
)
543 open_edge (edge
, os
);
544 output_edge (edge
, os
);
549 obstack_sgrow (os
, "}\n");
552 /*-------------------------------------------.
553 | Output functions (formatted) in obstack os |
554 `-------------------------------------------*/
557 output_node (node_t
*node
, struct obstack
*os
)
559 if (node
->title
!= N_TITLE
)
560 obstack_fgrow1 (os
, "\t\ttitle:\t\"%s\"\n", node
->title
);
561 if (node
->label
!= N_LABEL
)
562 obstack_fgrow1 (os
, "\t\tlabel:\t\"%s\"\n", node
->label
);
564 if ((node
->locx
!= N_LOCX
) && (node
->locy
!= N_LOCY
))
565 obstack_fgrow2 (os
, "\t\tloc { x: %d y: %d }\t\n", node
->locx
, node
->locy
);
567 if (node
->vertical_order
!= N_VERTICAL_ORDER
)
568 obstack_fgrow1 (os
, "\t\tvertical_order:\t%d\n", node
->vertical_order
);
569 if (node
->horizontal_order
!= N_HORIZONTAL_ORDER
)
570 obstack_fgrow1 (os
, "\t\thorizontal_order:\t%d\n", node
->horizontal_order
);
572 if (node
->width
!= N_WIDTH
)
573 obstack_fgrow1 (os
, "\t\twidth:\t%d\n", node
->width
);
574 if (node
->height
!= N_HEIGHT
)
575 obstack_fgrow1 (os
, "\t\theight:\t%d\n", node
->height
);
577 if (node
->shrink
!= N_SHRINK
)
578 obstack_fgrow1 (os
, "\t\tshrink:\t%d\n", node
->shrink
);
579 if (node
->stretch
!= N_STRETCH
)
580 obstack_fgrow1 (os
, "\t\tstretch:\t%d\n", node
->stretch
);
582 if (node
->folding
!= N_FOLDING
)
583 obstack_fgrow1 (os
, "\t\tfolding:\t%d\n", node
->folding
);
585 if (node
->textmode
!= N_TEXTMODE
)
586 obstack_fgrow1 (os
, "\t\ttextmode:\t%s\n",
587 get_textmode_str (node
->textmode
));
589 if (node
->shape
!= N_SHAPE
)
590 obstack_fgrow1 (os
, "\t\tshape:\t%s\n", get_shape_str (node
->shape
));
592 if (node
->borderwidth
!= N_BORDERWIDTH
)
593 obstack_fgrow1 (os
, "\t\tborderwidth:\t%d\n", node
->borderwidth
);
595 if (node
->color
!= N_COLOR
)
596 obstack_fgrow1 (os
, "\t\tcolor:\t%s\n", get_color_str (node
->color
));
597 if (node
->textcolor
!= N_TEXTCOLOR
)
598 obstack_fgrow1 (os
, "\t\ttextcolor:\t%s\n",
599 get_color_str (node
->textcolor
));
600 if (node
->bordercolor
!= N_BORDERCOLOR
)
601 obstack_fgrow1 (os
, "\t\tbordercolor:\t%s\n",
602 get_color_str (node
->bordercolor
));
605 obstack_fgrow1 (os
, "\t\tinfo1:\t\"%s\"\n", node
->infos
[0]);
607 obstack_fgrow1 (os
, "\t\tinfo2:\t\"%s\"\n", node
->infos
[1]);
609 obstack_fgrow1 (os
, "\t\tinfo3:\t\"%s\"\n", node
->infos
[2]);
613 output_edge (edge_t
*edge
, struct obstack
*os
)
615 /* FIXME: SOURCENAME and TARGETNAME are mandatory
616 so it has to be fatal not to give these informations. */
617 if (edge
->sourcename
!= E_SOURCENAME
)
618 obstack_fgrow1 (os
, "\t\tsourcename:\t\"%s\"\n", edge
->sourcename
);
619 if (edge
->targetname
!= E_TARGETNAME
)
620 obstack_fgrow1 (os
, "\t\ttargetname:\t\"%s\"\n", edge
->targetname
);
622 if (edge
->label
!= E_LABEL
)
623 obstack_fgrow1 (os
, "\t\tlabel:\t\"%s\"\n", edge
->label
);
625 if (edge
->linestyle
!= E_LINESTYLE
)
626 obstack_fgrow1 (os
, "\t\tlinestyle:\t\"%s\"\n",
627 get_linestyle_str(edge
->linestyle
));
629 if (edge
->thickness
!= E_THICKNESS
)
630 obstack_fgrow1 (os
, "\t\tthickness:\t%d\n", edge
->thickness
);
631 if (edge
->class != E_CLASS
)
632 obstack_fgrow1 (os
, "\t\tclass:\t%d\n", edge
->class);
634 if (edge
->color
!= E_COLOR
)
635 obstack_fgrow1 (os
, "\t\tcolor:\t%s\n", get_color_str (edge
->color
));
636 if (edge
->color
!= E_TEXTCOLOR
)
637 obstack_fgrow1 (os
, "\t\ttextcolor:\t%s\n",
638 get_color_str (edge
->textcolor
));
639 if (edge
->arrowcolor
!= E_ARROWCOLOR
)
640 obstack_fgrow1 (os
, "\t\tarrowcolor:\t%s\n",
641 get_color_str (edge
->arrowcolor
));
642 if (edge
->backarrowcolor
!= E_BACKARROWCOLOR
)
643 obstack_fgrow1 (os
, "\t\tbackarrowcolor:\t%s\n",
644 get_color_str (edge
->backarrowcolor
));
646 if (edge
->arrowsize
!= E_ARROWSIZE
)
647 obstack_fgrow1 (os
, "\t\tarrowsize:\t%d\n", edge
->arrowsize
);
648 if (edge
->backarrowsize
!= E_BACKARROWSIZE
)
649 obstack_fgrow1 (os
, "\t\tbackarrowsize:\t%d\n", edge
->backarrowsize
);
651 if (edge
->arrowstyle
!= E_ARROWSTYLE
)
652 obstack_fgrow1 (os
, "\t\tarrowstyle:\t%s\n",
653 get_arrowstyle_str(edge
->arrowstyle
));
654 if (edge
->backarrowstyle
!= E_BACKARROWSTYLE
)
655 obstack_fgrow1 (os
, "\t\tbackarrowstyle:\t%s\n",
656 get_arrowstyle_str(edge
->backarrowstyle
));
658 if (edge
->priority
!= E_PRIORITY
)
659 obstack_fgrow1 (os
, "\t\tpriority:\t%d\n", edge
->priority
);
660 if (edge
->anchor
!= E_ANCHOR
)
661 obstack_fgrow1 (os
, "\t\tanchor:\t%d\n", edge
->anchor
);
662 if (edge
->horizontal_order
!= E_HORIZONTAL_ORDER
)
663 obstack_fgrow1 (os
, "\t\thorizontal_order:\t%d\n", edge
->horizontal_order
);
667 output_graph (graph_t
*graph
, struct obstack
*os
)
670 obstack_fgrow1 (os
, "\ttitle:\t\"%s\"\n", graph
->title
);
672 obstack_fgrow1 (os
, "\tlabel:\t\"%s\"\n", graph
->label
);
675 obstack_fgrow1 (os
, "\tinfo1:\t\"%s\"\n", graph
->infos
[0]);
677 obstack_fgrow1 (os
, "\tinfo2:\t\"%s\"\n", graph
->infos
[1]);
679 obstack_fgrow1 (os
, "\tinfo3:\t\"%s\"\n", graph
->infos
[2]);
681 if (graph
->color
!= G_COLOR
)
682 obstack_fgrow1 (os
, "\tcolor:\t%s\n", get_color_str (graph
->color
));
683 if (graph
->textcolor
!= G_TEXTCOLOR
)
684 obstack_fgrow1 (os
, "\ttextcolor:\t%s\n", get_color_str (graph
->textcolor
));
685 if (graph
->bordercolor
!= G_BORDERCOLOR
)
686 obstack_fgrow1 (os
, "\tbordercolor:\t%s\n",
687 get_color_str (graph
->bordercolor
));
689 if (graph
->width
!= G_WIDTH
)
690 obstack_fgrow1 (os
, "\twidth:\t%d\n", graph
->width
);
691 if (graph
->height
!= G_HEIGHT
)
692 obstack_fgrow1 (os
, "\theight:\t%d\n", graph
->height
);
693 if (graph
->borderwidth
!= G_BORDERWIDTH
)
694 obstack_fgrow1 (os
, "\tborderwidth:\t%d\n", graph
->borderwidth
);
697 obstack_fgrow1 (os
, "\tx:\t%d\n", graph
->x
);
699 obstack_fgrow1 (os
, "\ty:\t%d\n", graph
->y
);
701 if (graph
->folding
!= G_FOLDING
)
702 obstack_fgrow1 (os
, "\tfolding:\t%d\n", graph
->folding
);
704 if (graph
->shrink
!= G_SHRINK
)
705 obstack_fgrow1 (os
, "\tshrink:\t%d\n", graph
->shrink
);
706 if (graph
->stretch
!= G_STRETCH
)
707 obstack_fgrow1 (os
, "\tstretch:\t%d\n", graph
->stretch
);
709 if (graph
->textmode
!= G_TEXTMODE
)
710 obstack_fgrow1 (os
, "\ttextmode:\t%s\n",
711 get_textmode_str (graph
->textmode
));
713 if (graph
->shape
!= G_SHAPE
)
714 obstack_fgrow1 (os
, "\tshape:\t%s\n", get_shape_str (graph
->shape
));
716 if (graph
->vertical_order
!= G_VERTICAL_ORDER
)
717 obstack_fgrow1 (os
, "\tvertical_order:\t%d\n", graph
->vertical_order
);
718 if (graph
->horizontal_order
!= G_HORIZONTAL_ORDER
)
719 obstack_fgrow1 (os
, "\thorizontal_order:\t%d\n", graph
->horizontal_order
);
721 if (graph
->xmax
!= G_XMAX
)
722 obstack_fgrow1 (os
, "\txmax:\t%d\n", graph
->xmax
);
723 if (graph
->ymax
!= G_YMAX
)
724 obstack_fgrow1 (os
, "\tymax:\t%d\n", graph
->ymax
);
726 if (graph
->xbase
!= G_XBASE
)
727 obstack_fgrow1 (os
, "\txbase:\t%d\n", graph
->xbase
);
728 if (graph
->ybase
!= G_YBASE
)
729 obstack_fgrow1 (os
, "\tybase:\t%d\n", graph
->ybase
);
731 if (graph
->xspace
!= G_XSPACE
)
732 obstack_fgrow1 (os
, "\txspace:\t%d\n", graph
->xspace
);
733 if (graph
->yspace
!= G_YSPACE
)
734 obstack_fgrow1 (os
, "\tyspace:\t%d\n", graph
->yspace
);
735 if (graph
->xlspace
!= G_XLSPACE
)
736 obstack_fgrow1 (os
, "\txlspace:\t%d\n", graph
->xlspace
);
738 if (graph
->xraster
!= G_XRASTER
)
739 obstack_fgrow1 (os
, "\txraster:\t%d\n", graph
->xraster
);
740 if (graph
->yraster
!= G_YRASTER
)
741 obstack_fgrow1 (os
, "\tyraster:\t%d\n", graph
->yraster
);
742 if (graph
->xlraster
!= G_XLRASTER
)
743 obstack_fgrow1 (os
, "\txlraster:\t%d\n", graph
->xlraster
);
745 if (graph
->hidden
!= G_HIDDEN
)
746 obstack_fgrow1 (os
, "\thidden:\t%d\n", graph
->hidden
);
748 /* FIXME: Unallocate struct list if required.
749 Maybe with a little function. */
750 if (graph
->classname
!= G_CLASSNAME
)
752 struct classname_s
*ite
;
754 for (ite
= graph
->classname
; ite
; ite
= ite
->next
)
755 obstack_fgrow2 (os
, "\tclassname %d :\t%s\n", ite
->no
, ite
->name
);
758 if (graph
->infoname
!= G_INFONAME
)
760 struct infoname_s
*ite
;
762 for (ite
= graph
->infoname
; ite
; ite
= ite
->next
)
763 obstack_fgrow2 (os
, "\tinfoname %d :\t%s\n", ite
->integer
, ite
->string
);
766 if (graph
->colorentry
!= G_COLORENTRY
)
768 struct colorentry_s
*ite
;
771 for (ite
= graph
->colorentry
; ite
; ite
= ite
->next
)
773 sprintf (buff
, "\tcolorentry %d :\t%d %d %d\n",
778 obstack_sgrow (os
, buff
);
782 if (graph
->layoutalgorithm
!= G_LAYOUTALGORITHM
)
783 obstack_fgrow1 (os
, "\tlayoutalgorithm:\t%s\n",
784 get_layoutalgorithm_str(graph
->layoutalgorithm
));
786 if (graph
->layout_downfactor
!= G_LAYOUT_DOWNFACTOR
)
787 obstack_fgrow1 (os
, "\tlayout_downfactor:\t%d\n", graph
->layout_downfactor
);
788 if (graph
->layout_upfactor
!= G_LAYOUT_UPFACTOR
)
789 obstack_fgrow1 (os
, "\tlayout_upfactor:\t%d\n", graph
->layout_upfactor
);
790 if (graph
->layout_nearfactor
!= G_LAYOUT_NEARFACTOR
)
791 obstack_fgrow1 (os
, "\tlayout_nearfactor:\t%d\n", graph
->layout_nearfactor
);
792 if (graph
->layout_splinefactor
!= G_LAYOUT_SPLINEFACTOR
)
793 obstack_fgrow1 (os
, "\tlayout_splinefactor:\t%d\n",
794 graph
->layout_splinefactor
);
796 if (graph
->late_edge_labels
!= G_LATE_EDGE_LABELS
)
797 obstack_fgrow1 (os
, "\tlate_edge_labels:\t%s\n",
798 get_decision_str(graph
->late_edge_labels
));
799 if (graph
->display_edge_labels
!= G_DISPLAY_EDGE_LABELS
)
800 obstack_fgrow1 (os
, "\tdisplay_edge_labels:\t%s\n",
801 get_decision_str(graph
->display_edge_labels
));
802 if (graph
->dirty_edge_labels
!= G_DIRTY_EDGE_LABELS
)
803 obstack_fgrow1 (os
, "\tdirty_edge_labels:\t%s\n",
804 get_decision_str(graph
->dirty_edge_labels
));
805 if (graph
->finetuning
!= G_FINETUNING
)
806 obstack_fgrow1 (os
, "\tfinetuning:\t%s\n",
807 get_decision_str(graph
->finetuning
));
808 if (graph
->ignore_singles
!= G_IGNORE_SINGLES
)
809 obstack_fgrow1 (os
, "\tignore_singles:\t%s\n",
810 get_decision_str(graph
->ignore_singles
));
811 if (graph
->straight_phase
!= G_STRAIGHT_PHASE
)
812 obstack_fgrow1 (os
, "\tstraight_phase:\t%s\n",
813 get_decision_str(graph
->straight_phase
));
814 if (graph
->priority_phase
!= G_PRIORITY_PHASE
)
815 obstack_fgrow1 (os
, "\tpriority_phase:\t%s\n",
816 get_decision_str(graph
->priority_phase
));
817 if (graph
->manhattan_edges
!= G_MANHATTAN_EDGES
)
819 "\tmanhattan_edges:\t%s\n",
820 get_decision_str(graph
->manhattan_edges
));
821 if (graph
->smanhattan_edges
!= G_SMANHATTAN_EDGES
)
823 "\tsmanhattan_edges:\t%s\n",
824 get_decision_str(graph
->smanhattan_edges
));
825 if (graph
->near_edges
!= G_NEAR_EDGES
)
826 obstack_fgrow1 (os
, "\tnear_edges:\t%s\n",
827 get_decision_str(graph
->near_edges
));
829 if (graph
->orientation
!= G_ORIENTATION
)
830 obstack_fgrow1 (os
, "\torientation:\t%s\n",
831 get_orientation_str(graph
->orientation
));
833 if (graph
->node_alignement
!= G_NODE_ALIGNEMENT
)
834 obstack_fgrow1 (os
, "\tnode_alignement:\t%s\n",
835 get_node_alignement_str(graph
->node_alignement
));
837 if (graph
->port_sharing
!= G_PORT_SHARING
)
838 obstack_fgrow1 (os
, "\tport_sharing:\t%s\n",
839 get_decision_str(graph
->port_sharing
));
841 if (graph
->arrow_mode
!= G_ARROW_MODE
)
842 obstack_fgrow1 (os
, "\tarrow_mode:\t%s\n",
843 get_arrow_mode_str(graph
->arrow_mode
));
845 if (graph
->treefactor
!= G_TREEFACTOR
)
846 obstack_fgrow1 (os
, "\ttreefactor:\t%f\n", graph
->treefactor
);
847 if (graph
->spreadlevel
!= G_SPREADLEVEL
)
848 obstack_fgrow1 (os
, "\tspreadlevel:\t%d\n", graph
->spreadlevel
);
850 if (graph
->crossing_weight
!= G_CROSSING_WEIGHT
)
851 obstack_fgrow1 (os
, "\tcrossing_weight:\t%s\n",
852 get_crossing_type_str(graph
->crossing_weight
));
853 if (graph
->crossing_phase2
!= G_CROSSING_PHASE2
)
854 obstack_fgrow1 (os
, "\tcrossing_phase2:\t%s\n",
855 get_decision_str(graph
->crossing_phase2
));
856 if (graph
->crossing_optimization
!= G_CROSSING_OPTIMIZATION
)
857 obstack_fgrow1 (os
, "\tcrossing_optimization:\t%s\n",
858 get_decision_str(graph
->crossing_optimization
));
860 if (graph
->view
!= G_VIEW
)
861 obstack_fgrow1 (os
, "\tview:\t%s\n", get_view_str(graph
->view
));
863 if (graph
->edges
!= G_EDGES
)
864 obstack_fgrow1 (os
, "\tedges:\t%s\n", get_decision_str(graph
->edges
));
866 if (graph
->nodes
!= G_NODES
)
867 obstack_fgrow1 (os
,"\tnodes:\t%s\n", get_decision_str(graph
->nodes
));
869 if (graph
->splines
!= G_SPLINES
)
870 obstack_fgrow1 (os
, "\tsplines:\t%s\n", get_decision_str(graph
->splines
));
872 if (graph
->bmax
!= G_BMAX
)
873 obstack_fgrow1 (os
, "\tbmax:\t%d\n", graph
->bmax
);
874 if (graph
->cmin
!= G_CMIN
)
875 obstack_fgrow1 (os
, "\tcmin:\t%d\n", graph
->cmin
);
876 if (graph
->cmax
!= G_CMAX
)
877 obstack_fgrow1 (os
, "\tcmax:\t%d\n", graph
->cmax
);
878 if (graph
->pmin
!= G_PMIN
)
879 obstack_fgrow1 (os
, "\tpmin:\t%d\n", graph
->pmin
);
880 if (graph
->pmax
!= G_PMAX
)
881 obstack_fgrow1 (os
, "\tpmax:\t%d\n", graph
->pmax
);
882 if (graph
->rmin
!= G_RMIN
)
883 obstack_fgrow1 (os
, "\trmin:\t%d\n", graph
->rmin
);
884 if (graph
->rmax
!= G_RMAX
)
885 obstack_fgrow1 (os
, "\trmax:\t%d\n", graph
->rmax
);
886 if (graph
->smax
!= G_SMAX
)
887 obstack_fgrow1 (os
, "\tsmax:\t%d\n", graph
->smax
);