Turnstone Operating System
Loading...
Searching...
No Matches
list_linked.64.c File Reference

linked list types implementations More...

#include <types.h>
#include <list.h>
#include <indexer.h>
#include <cpu/sync.h>
#include <strings.h>
#include <logging.h>

Classes

struct  list_item_t
 
struct  list_t
 list internal interface More...
 
struct  linkedlist_iterator_internal_t
 iterator struct More...
 

Typedefs

typedef struct list_item_t list_item_t
 short hand for struct
 
typedef struct list_t list_t
 short hand for struct
 
typedef struct linkedlist_iterator_internal_t linkedlist_iterator_internal_t
 short hand for struct
 

Functions

 MODULE ("turnstone.lib")
 
list_tlinkedlist_create_with_type (memory_heap_t *heap, list_type_t type, list_data_comparator_f comparator, indexer_t indexer)
 
uint8_t linkedlist_destroy_with_type (list_t *list, list_destroy_type_t type, list_item_destroyer_callback_f destroyer)
 
size_t linkedlist_insert_at (list_t *list, const void *data, list_insert_delete_at_t where, size_t position)
 
const void * linkedlist_delete_at (list_t *list, const void *data, list_insert_delete_at_t where, size_t position)
 
list_tlinkedlist_duplicate_list_with_heap (memory_heap_t *heap, list_t *list)
 
iterator_tlinkedlist_iterator_create (list_t *list)
 
const void * linkedlist_get_data_at_position (list_t *list, size_t position)
 
int8_t linkedlist_get_position (list_t *list, const void *data, size_t *position)
 
int8_t linkedlist_iterator_destroy (iterator_t *iterator)
 destroys the iterator More...
 
iterator_tlinkedlist_iterator_next (iterator_t *iterator)
 iterates next item of list. More...
 
int8_t linkedlist_iterator_end_of_list (iterator_t *iterator)
 checks if iterator is at end of the list More...
 
const void * linkedlist_iterator_get_item (iterator_t *iterator)
 returns data at current item More...
 
int8_t linkedlist_narrow (list_t *list, size_t s, const void *data, list_item_t **head, list_item_t **tail, size_t *position)
 
const void * linkedlist_iterator_delete_item (iterator_t *iterator)
 deletes current item. More...
 

Detailed Description

linked list types implementations

This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.

Function Documentation

◆ linkedlist_iterator_delete_item()

const void * linkedlist_iterator_delete_item ( iterator_t iterator)

deletes current item.

Parameters
[in]iteratorthe iterator
Returns
deleted item

current item is deleted and the value of item is returned. also list metadata is updated.

◆ linkedlist_iterator_destroy()

int8_t linkedlist_iterator_destroy ( iterator_t iterator)

destroys the iterator

Parameters
[in]iteratorto destroy.
Returns
0 if succeed.

◆ linkedlist_iterator_end_of_list()

int8_t linkedlist_iterator_end_of_list ( iterator_t iterator)

checks if iterator is at end of the list

Parameters
[in]iteratorthe iterator
Returns
0 if the iterator is at the end of list.

◆ linkedlist_iterator_get_item()

const void * linkedlist_iterator_get_item ( iterator_t iterator)

returns data at current item

Parameters
[in]iteratorthe iterator
Returns
data

◆ linkedlist_iterator_next()

iterator_t * linkedlist_iterator_next ( iterator_t iterator)

iterates next item of list.

Parameters
[in]iteratorthe iterator
Returns
itself