Main Page   Compound List   File List   Compound Members   File Members  

write_vcg.c

Go to the documentation of this file.
00001 /* 
00002  *  Cflow2VCG
00003  *  Copyright (C) 2001 Guilhem BONNEFILLE
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018  */
00019 
00020 #include <stdio.h>
00021 #include <stdlib.h>
00022 #include "cflow2vcg.h"
00023 
00024 #define ARC_INT 1
00025 #define ARC_EXT 2
00026 
00027 #define FMT_NOEUD "node: { title: \"%d\" label: \"%s\" info1: \"%d\" info2: \"%s\" info3: \"%s:%d\" }\n"
00028 #define FMT_ARC "edge: { sourcename: \"%d\" targetname: \"%d\" class: %d }\n"
00029 
00030 #define FMT_HEAD "graph: {\ntitle: \"TITLE\"\ncolor: lightgray\n" \
00031   "classname 1 : \"Interne\" classname 2 : \"Externe\"\n"
00032 #define FMT_HEAD_SELECT_INVISIBLE "invisible: %d\n"
00033 #define FMT_FOOT "}\n"
00034 
00035 void
00036 afficher_entete ()
00037 {
00038         (void) fprintf (stdout, FMT_HEAD);
00039         if (classe_inv != CLASS_NULL)
00040                 (void) fprintf (stdout, FMT_HEAD_SELECT_INVISIBLE,
00041                                 classe_inv);
00042 }
00043 
00044 void
00045 afficher_pied ()
00046 {
00047         (void) fprintf (stdout, FMT_FOOT);
00048 }
00049 
00050 void
00051 afficher_noeud (const char *label, int numlig,
00052                 const char *type, const char *fichier_source,
00053                 int numlig_source)
00054 {
00055         (void) fprintf (stdout, FMT_NOEUD, numlig, label, numlig,
00056                         type, fichier_source, numlig_source);
00057 }
00058 
00059 void
00060 afficher_arc (int src, int dst)
00061 {
00062         if (rechercher_parmi_interne(dst) != NULL)
00063                 (void) fprintf (stdout, FMT_ARC, src, dst, ARC_INT);
00064         else
00065                 (void) fprintf (stdout, FMT_ARC, src, dst, ARC_EXT);
00066 }

Generated on Thu Apr 10 21:55:08 2003 for Cflow2VCG by doxygen1.2.15