OS1/smallsh/node.h

24 lines
508 B
C

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