1
0
mirror of https://gitlab.com/klmp200/LO41.git synced 2025-07-11 12:19:25 +00:00

Voilà, normalement, les listes fonctionnent

This commit is contained in:
2018-06-05 15:52:48 +02:00
parent a72587d430
commit 6ab2711c9c
4 changed files with 149 additions and 13 deletions

View File

@ -11,7 +11,7 @@ typedef struct o_Element Element;
#include "Element.h"
#define WRONG_ELEMENT CRASH("This element is not within the list\n")
#define OUTSIDE_BOUNDS CRASH("You are outside of the list\n")
struct o_List {
PRIVATE Element *head;
@ -20,12 +20,22 @@ struct o_List {
PUBLIC Element *(*get_head)(_THIS(List));
PUBLIC Element *(*get_tail)(_THIS(List));
PUBLIC Element *(*get_element)(_THIS(List), int index);
PUBLIC void* (*get_head_data)(_THIS(List));
PUBLIC void* (*get_tail_data)(_THIS(List));
PUBLIC void* (*get_element_data)(_THIS(List), int index);
PUBLIC int (*get_size)(_THIS(List));
PUBLIC void (*insert_inside)(_THIS(List), void * data, size_t data_size, int index);
PUBLIC void (*insert_tail)(_THIS(List), void * data, size_t data_size);
PUBLIC void (*insert_head)(_THIS(List), void * data, size_t data_size);
PUBLIC void (*clear)(_THIS(List));
PUBLIC void (*remove_head)(_THIS(List));
PUBLIC void (*remove_tail)(_THIS(List));
DESTRUCTOR(List);
};