Commit 867d49d0 authored by Chris Müller's avatar Chris Müller

lib: Rename struct CryPosition to struct CryIndex.

parent 8ad9ba34
......@@ -146,7 +146,7 @@ cry_list_prepend(struct CryList* list, pointer data)
void
cry_list_insert(struct CryList* list, struct CryPosition* position, pointer data)
cry_list_insert(struct CryList* list, struct CryIndex* position, pointer data)
{
assert(list != 0);
......@@ -165,26 +165,26 @@ cry_list_insert(struct CryList* list, struct CryPosition* position, pointer data
}
struct CryPosition*
struct CryIndex*
cry_list_begin(struct CryList* list)
{
assert(list != 0);
return cry_cast(struct CryPosition*, list->head);
return cry_cast(struct CryIndex*, list->head);
}
struct CryPosition*
struct CryIndex*
cry_list_end(struct CryList* list)
{
assert(list != 0);
return cry_cast(struct CryPosition*, list->tail);
return cry_cast(struct CryIndex*, list->tail);
}
struct CryPosition*
struct CryIndex*
cry_list_index(struct CryList* list, size_t index)
{
assert(list != 0);
......@@ -196,32 +196,32 @@ cry_list_index(struct CryList* list, size_t index)
--index;
}
return cry_cast(struct CryPosition*, node);
return cry_cast(struct CryIndex*, node);
}
struct CryPosition*
cry_list_next(struct CryPosition* position)
struct CryIndex*
cry_list_next(struct CryIndex* position)
{
assert(position != 0);
return cry_cast(struct CryPosition*, cry_cast(struct Node*, position)->next);
return cry_cast(struct CryIndex*, cry_cast(struct Node*, position)->next);
}
struct CryPosition*
cry_list_prev(struct CryPosition* position)
struct CryIndex*
cry_list_prev(struct CryIndex* position)
{
assert(position != 0);
return cry_cast(struct CryPosition*, cry_cast(struct Node*, position)->prev);
return cry_cast(struct CryIndex*, cry_cast(struct Node*, position)->prev);
}
struct CryPosition*
cry_list_step(struct CryPosition* position, int index)
struct CryIndex*
cry_list_step(struct CryIndex* position, int index)
{
assert(position != 0);
......@@ -237,12 +237,12 @@ cry_list_step(struct CryPosition* position, int index)
}
}
return cry_cast(struct CryPosition*, node);
return cry_cast(struct CryIndex*, node);
}
pointer
cry_list_data(struct CryPosition* position)
cry_list_data(struct CryIndex* position)
{
assert(position != 0);
......@@ -252,7 +252,7 @@ cry_list_data(struct CryPosition* position)
pointer
cry_list_swap(struct CryPosition* position, pointer new_data)
cry_list_swap(struct CryIndex* position, pointer new_data)
{
struct Node* node = cry_cast(struct Node*, position);
pointer tmp = node->data;
......@@ -262,7 +262,7 @@ cry_list_swap(struct CryPosition* position, pointer new_data)
pointer
cry_list_remove(struct CryList* list, struct CryPosition* position)
cry_list_remove(struct CryList* list, struct CryIndex* position)
{
assert(list != 0);
assert(position != 0);
......
......@@ -21,7 +21,7 @@
#include "structures.h"
struct CryPosition;
struct CryIndex;
struct CryList;
struct CryList* cry_list_new(void);
......@@ -33,25 +33,20 @@ pointer cry_list_tail(struct CryList* list);
void cry_list_append(struct CryList* list, pointer data);
void cry_list_prepend(struct CryList* list, pointer data);
void cry_list_insert(struct CryList* list, struct CryPosition* position, pointer data);
void cry_list_insert(struct CryList* list, struct CryIndex* position, pointer data);
struct CryPosition* cry_list_begin(struct CryList* list);
struct CryPosition* cry_list_end(struct CryList* list);
struct CryPosition* cry_list_index(struct CryList* list, size_t index);
struct CryIndex* cry_list_begin(struct CryList* list);
struct CryIndex* cry_list_end(struct CryList* list);
struct CryIndex* cry_list_index(struct CryList* list, size_t index);
struct CryPosition* cry_list_next(struct CryPosition* position);
struct CryPosition* cry_list_prev(struct CryPosition* position);
struct CryPosition* cry_list_step(struct CryPosition* position, int steps);
pointer cry_list_data(struct CryPosition* position);
pointer cry_list_swap(struct CryPosition* position, pointer new_data);
struct CryIndex* cry_list_next(struct CryIndex* position);
struct CryIndex* cry_list_prev(struct CryIndex* position);
struct CryIndex* cry_list_step(struct CryIndex* position, int steps);
pointer cry_list_data(struct CryIndex* position);
pointer cry_list_swap(struct CryIndex* position, pointer new_data);
pointer cry_list_remove(struct CryList* list, struct CryPosition* position);
pointer cry_list_remove(struct CryList* list, struct CryIndex* position);
struct CryList* cry_list_concat(struct CryList* first, struct CryList* second);
/*
struct CryList* cry_list_filter(struct CryList* list, cry_predicate_function predicate, pointer context);
struct CryList* cry_list_map(struct CryList* list, cry_mapping_function mapping, pointer context);
*/
#endif // CRYSTAL_STRUCTURES_LIST_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment