Made the list implementation more generic to hold various types, includung structs. Updated traversing function that accepts a function pointer that contains the logic to print element in the list

This commit is contained in:
amazing-username
2019-07-23 21:07:50 -04:00
parent 729f87fee0
commit d96758277a
2 changed files with 18 additions and 12 deletions
+3 -3
View File
@@ -1,10 +1,10 @@
#include "types.h"
struct node* init_list(void*);
struct node* init_list(void*, size_t);
int is_list_init(struct node**);
void insert_at_begin(struct node**, void*);
void insert_at_end(struct node**, void*);
void insert_at_begin(struct node**, void*, size_t);
void insert_at_end(struct node**, void*, size_t);
void free_list(struct node**);
void traverse(struct node*, void (*)(struct node*));