/* SCCS-info %W% %E% */ /*--------------------------------------------------------------------*/ /* */ /* VCG : Visualization of Compiler Graphs */ /* -------------------------------------- */ /* */ /* file: grprint.c */ /* version: 1.00.00 */ /* creation: 14.4.93 */ /* author: G. Sander (Version 1.00.00-...) */ /* Universitaet des Saarlandes, 66041 Saarbruecken */ /* ESPRIT Project #5399 Compare */ /* description: Print layout into a file */ /* status: in work */ /* */ /*--------------------------------------------------------------------*/ #ifndef lint static char *id_string="$Id: grprint.c,v 3.8 1995/02/08 11:11:14 sander Exp $"; #endif /* * Copyright (C) 1993-2005 Saarland University * * This program and documentation is free software; you can redistribute * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * The software is available per anonymous ftp at ftp.cs.uni-sb.de. * Contact sander@cs.uni-sb.de for additional information. */ /* * $Log: grprint.c,v $ * Revision 3.8 1995/02/08 11:11:14 sander * Distribution version 1.3. * * Revision 3.7 1994/12/23 18:12:45 sander * Manhatten layout added. * Option interface cleared. * infobox behaviour improved. * First version of fisheye (carthesian). * Options Noedge and nonode. * * Revision 3.6 1994/08/03 13:58:44 sander * Horizontal order mechanism changed. * Attribute horizontal_order for edges added. * * Revision 3.5 1994/06/07 14:09:59 sander * Splines implemented. * HP-UX, Linux, AIX, Sun-Os, IRIX compatibility tested. * The tool is now ready to be distributed. * * Revision 3.4 1994/05/17 16:39:10 sander * attribute node_align added to allow nodes to be centered in the levels. * * Revision 3.3 1994/05/16 08:56:03 sander * shape attribute (boxes, rhombs, ellipses, triangles) added. * * Revision 3.2 1994/05/05 08:20:30 sander * Small corrections. * * Revision 3.1 1994/03/01 10:59:55 sander * Copyright and Gnu Licence message added. * Problem with "nearedges: no" and "selfloops" solved. * * Revision 2.2 1994/01/21 19:33:46 sander * VCG Version tested on Silicon Graphics IRIX, IBM R6000 AIX and Sun 3/60. * Option handling improved. Option -grabinputfocus installed. * X11 Font selection scheme implemented. The user can now select a font * during installation. * Sun K&R C (a nonansi compiler) tested. Some portabitility problems solved. * * Revision 2.1 1993/12/08 21:20:09 sander * Reasonable fast and stable version * * */ /************************************************************************ * This file allows to write a layouted graph into a file in * such a way that this file can be reloaded. * * This file here provides the following functions: * print_graph prints the full graph in ASCII form to a * file * color_text converts a color into a text * textmode_text converts a textmode into a text * linestyle_text converts a linestyle into a text ************************************************************************/ #include #include #include "globals.h" #include "main.h" #include "options.h" #include "alloc.h" #include "folding.h" #include "steps.h" #include "fisheye.h" #include "grprint.h" /* Prototypes * ---------- */ static void open_graph _PP(( FILE *f)); static void print_node _PP(( FILE *f, GNODE v)); static void bbend_node _PP(( FILE *f, GEDGE e, int k)); static void tbend_node _PP(( FILE *f, GEDGE e, int k)); static void print_edge _PP(( FILE *f, GEDGE e)); /* For indentation */ static int actindent; /*--------------------------------------------------------------------*/ /* Print all nodes and edges */ /*--------------------------------------------------------------------*/ /* Macro for indentation */ #define INDPRINT(f,fmt,arg) {{ int i;\ for (i=0; ix3)) topbend = 0; if ((x1>x3) && (x1-s*8/10y3)) topbend = 0; if ((y1>y3) && (y1-s*8/10x4)) botbend = 0; if ((x2>x4) && (x2-s*8/10y4)) botbend = 0; if ((y2>y4) && (y2-s*8/10