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