Main Page   Compound List   File List   Compound Members   File Members  

write_dot.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 "\t\"%d\" -> \"%d\" ;\n"
00029 
00030 #define FMT_HEAD "digraph sarien {\n" \
00031                  "edge [color=black style=solid];\n"
00032 #define FMT_FOOT "}\n"
00033 
00034 void
00035 afficher_entete ()
00036 {
00037   fputs(FMT_HEAD, stdout);
00038 }
00039 
00040 void
00041 afficher_pied ()
00042 {
00043   fputs(FMT_FOOT, stdout);
00044 }
00045 
00046 void
00047 afficher_noeud (const char *label, int numlig,
00048                 const char *type, const char *fichier_source,
00049                 int numlig_source)
00050 {
00051         (void) fprintf (stdout, FMT_NOEUD, numlig, label, numlig,
00052                         type, fichier_source, numlig_source);
00053 }
00054 
00055 void
00056 afficher_arc (int src, int dst)
00057 {
00058         if (rechercher_parmi_interne(dst) != NULL)
00059                 (void) fprintf (stdout, FMT_ARC, src, dst, ARC_INT);
00060         else
00061                 (void) fprintf (stdout, FMT_ARC, src, dst, ARC_EXT);
00062 }

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