00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
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 }