Ajout d'une fonction de débug

This commit is contained in:
n07070 2020-04-01 17:28:15 +02:00
parent a832c2f64c
commit fb35033502
2 changed files with 10 additions and 0 deletions

View File

@ -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){

View File

@ -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