Work in progress

This commit is contained in:
Michael Tryby
2019-04-10 17:59:55 -04:00
parent 6187bc112e
commit f10e36336f
3 changed files with 25 additions and 20 deletions

View File

@@ -27,21 +27,6 @@
#include "list.h"
typedef struct list_node_s {
void *data;
list_node_t *next;
} list_node_t;
typedef struct list_s {
int logicalLength;
size_t elementSize;
list_node_t *head;
list_node_t *tail;
freeFunction freeFn;
} list_t;
list_t *create_list(size_t elementSize, freeFunction freeFn)
{
list_t *list;

View File

@@ -25,12 +25,22 @@ extern "C" {
// a common function used to free malloc'd objects
typedef void(*freeFunction)(void *);
typedef bool (*listIterator)(void *);
typedef bool(*listIterator)(void *);
// forward declarations
typedef struct list_node_s list_node_t;
typedef struct list_s list_t;
typedef struct list_node_s {
void *data;
struct list_node_s *next;
} list_node_t;
typedef struct {
int logicalLength;
size_t elementSize;
list_node_t *head;
list_node_t *tail;
freeFunction freeFn;
} list_t;
/**