First commit, fixed appending, create, destroy and get, all working fine
This commit is contained in:
26
include/linkedlist.h
Normal file
26
include/linkedlist.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef LINKEDLIST_H
|
||||
#define LINKEDLIST_H
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct LinkedList LinkedList;
|
||||
|
||||
typedef enum {
|
||||
LLIST_OK = 0,
|
||||
LLIST_ALLOC,
|
||||
LLIST_NULL,
|
||||
LLIST_NULL_ARG,
|
||||
LLIST_OUT_OF_BOUNDS,
|
||||
LLIST_INVALID_SIZE,
|
||||
} LinkedListErr;
|
||||
|
||||
LinkedListErr linkedlist_create(LinkedList **out, size_t elem_size);
|
||||
LinkedListErr linkedlist_destroy(LinkedList *ll);
|
||||
|
||||
LinkedListErr linkedlist_append(LinkedList *ll, void *data);
|
||||
LinkedListErr linkedlist_delete(LinkedList *ll, size_t index);
|
||||
LinkedListErr linkedlist_pop(LinkedList *ll, size_t index, void *out);
|
||||
LinkedListErr linkedlist_insert(LinkedList *ll, size_t index, void *out);
|
||||
LinkedListErr linkedlist_get(const LinkedList *ll, size_t index, void *out);
|
||||
|
||||
#endif /* ifndef LINKEDLIST_H */
|
||||
Reference in New Issue
Block a user