From fb35033502e2ca6313bdf0922f94ecb9a084958c Mon Sep 17 00:00:00 2001 From: n07070 Date: Wed, 1 Apr 2020 17:28:15 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Ajout=20d'une=20fonction=20de=20d=C3=A9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/node.c | 8 ++++++++ src/node.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/node.c b/src/node.c index 499651d..d90071d 100644 --- a/src/node.c +++ b/src/node.c @@ -13,6 +13,12 @@ /* ---- Fonctions utilitaires ---- */ +void debug_print(char message_debug){ + if (debug_flag == 1) { + printf("\x1b[33m\x1b[4m>> Debug :\x1b[0m\x1b[33m %s\x1b[0m\n", message_debug ); + } +} + // Get list length int len_list(list *l) { int len = 0; @@ -292,6 +298,8 @@ void listen_for_packets(){ int main(int argc, const char *argv[]) { int cont = 1; + int debug_flag = 0; + while(cont){ diff --git a/src/node.h b/src/node.h index d4ba94b..be84adf 100644 --- a/src/node.h +++ b/src/node.h @@ -88,6 +88,8 @@ void t_get_network_state(); // Helper functions int len_list(list *l); +void debug_print(char message_debug); + neighbour_peer *get_random_neighbour(); #endif From 06fa230463f491c592f8e9af42cb2320b5322fa8 Mon Sep 17 00:00:00 2001 From: n07070 Date: Wed, 29 Apr 2020 13:59:58 +0200 Subject: [PATCH 2/2] Added gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2aad53d --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +dazibao +*.o +debug.*