/* * Cflow2VCG * Copyright (C) 2001 Guilhem BONNEFILLE * * This program is free software; you can redistribute it and/or modify * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "cflow2vcg.h" #define ARC_INT 1 #define ARC_EXT 2 #define FMT_NOEUD "node: { title: \"%d\" label: \"%s\" info1: \"%d\" info2: \"%s\" info3: \"%s:%d\" }\n" #define FMT_ARC "edge: { sourcename: \"%d\" targetname: \"%d\" class: %d }\n" #define FMT_HEAD "graph: {\ntitle: \"TITLE\"\ncolor: lightgray\n" \ "classname 1 : \"Interne\" classname 2 : \"Externe\"\n" #define FMT_HEAD_SELECT_INVISIBLE "invisible: %d\n" #define FMT_FOOT "}\n" void afficher_entete () { (void) fprintf (stdout, FMT_HEAD); if (classe_inv != CLASS_NULL) (void) fprintf (stdout, FMT_HEAD_SELECT_INVISIBLE, classe_inv); } void afficher_pied () { (void) fprintf (stdout, FMT_FOOT); } void afficher_noeud (const char *label, int numlig, const char *type, const char *fichier_source, int numlig_source) { (void) fprintf (stdout, FMT_NOEUD, numlig, label, numlig, type, fichier_source, numlig_source); } void afficher_arc (int src, int dst) { if (rechercher_parmi_interne(dst) != NULL) (void) fprintf (stdout, FMT_ARC, src, dst, ARC_INT); else (void) fprintf (stdout, FMT_ARC, src, dst, ARC_EXT); }