OS1/movies/node.h

25 lines
508 B
C
Raw Normal View History

#include "stdlib.h"
#ifndef NODES
#define NODES
struct node {
struct node* node;
void* data;
};
2023-10-15 16:11:39 -07:00
// Appends Node to list
void append_node(struct node*, struct node*);
2023-10-15 16:11:39 -07:00
// Creates node with value and appends
// Returns node that was created
struct node* appendv_node(struct node*, void*);
2023-10-15 16:11:39 -07:00
// Counts the number of nodes in a list
2023-10-13 01:39:26 -07:00
int count_nodes(struct node*);
2023-10-15 16:11:39 -07:00
// Iterates over every node in a list and runs the given function
void iterate_nodes(struct node*, void *func(void*, void*), void*);
#endif