useful_utils.c
1 /* ************************************************************************** */ 2 /* */ 3 /* ::: :::::::: */ 4 /* useful_utils.c :+: :+: :+: */ 5 /* +:+ +:+ +:+ */ 6 /* By: gychoi <gychoi@student.42seoul.kr> +#+ +:+ +#+ */ 7 /* +#+#+#+#+#+ +#+ */ 8 /* Created: 2022/12/04 22:02:17 by gychoi #+# #+# */ 9 /* Updated: 2022/12/04 22:47:12 by gychoi ### ########.fr */ 10 /* */ 11 /* ************************************************************************** */ 12 13 #include <stdio.h> 14 void iterr(t_deque *deq) 15 { 16 t_list *node; 17 18 node = deq->head; 19 while (node != NULL) 20 { 21 printf("%d ", node->data); 22 node = node->next; 23 } 24 } 25 void show_deque(t_deque *a, t_deque *b) 26 { 27 printf("\n\tA FRONT "); 28 iterr(a); 29 printf("REAR\n"); 30 printf("\tB FRONT "); 31 iterr(b); 32 printf("REAR\n\n"); 33 } 34 35 #include <stdlib.h> 36 37 void check_leak(void) 38 { 39 system("leaks --list -- checker"); 40 } 41 // atexit(check_leak)