mirror of
https://github.com/bkthomps/Containers.git
synced 2025-11-16 04:24:47 +00:00
@@ -33,7 +33,7 @@ struct internal_array {
|
||||
/**
|
||||
* Initializes an array.
|
||||
*
|
||||
* @param element_count the amount of elements in the array; must not be
|
||||
* @param element_count the number of elements in the array; must not be
|
||||
* negative
|
||||
* @param data_size the size of each element in the array; must be positive
|
||||
*
|
||||
@@ -149,7 +149,7 @@ int array_set(array me, const int index, void *const data)
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies the element at index of the array to data. The pointer to the data
|
||||
* Copies the element at an index of the array to data. The pointer to the data
|
||||
* being obtained should point to the data type which this array holds. For
|
||||
* example, if this array holds integers, the data pointer should be a pointer
|
||||
* to an integer. Since this data is being copied from the array to the data
|
||||
|
||||
18
src/deque.c
18
src/deque.c
@@ -79,11 +79,11 @@ deque deque_init(const size_t data_size)
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the size of the deque. The size is the amount of data spaces being
|
||||
* Determines the size of the deque. The size is the number of data spaces being
|
||||
* used. The size starts at zero, and every time an element is added, it
|
||||
* increases by one.
|
||||
*
|
||||
* @param me the deque to check size of
|
||||
* @param me the deque to check the size of
|
||||
*
|
||||
* @return the size of the deque
|
||||
*/
|
||||
@@ -116,7 +116,7 @@ int deque_is_empty(deque me)
|
||||
int deque_trim(deque me)
|
||||
{
|
||||
int i;
|
||||
/* The start and end blocks are written like this because in C89, */
|
||||
/* The start and end blocks are written like this because in C89 */
|
||||
/* negative integer division and modulo are implementation-defined. */
|
||||
const int start_block =
|
||||
me->start_index == -1 ? 0 : me->start_index / BLOCK_SIZE;
|
||||
@@ -351,7 +351,7 @@ int deque_pop_back(void *const data, deque me)
|
||||
* Since the data is being copied, the pointer only has to be valid when this
|
||||
* function is called.
|
||||
*
|
||||
* @param me the deque to set value of
|
||||
* @param me the deque to set the value of
|
||||
* @param data the data to set
|
||||
*
|
||||
* @return 0 if no error
|
||||
@@ -369,7 +369,7 @@ int deque_set_first(deque me, void *const data)
|
||||
* to an integer. Since the data is being copied, the pointer only has to be
|
||||
* valid when this function is called.
|
||||
*
|
||||
* @param me the deque to set value of
|
||||
* @param me the deque to set the value of
|
||||
* @param index the index to set at
|
||||
* @param data the data to set
|
||||
*
|
||||
@@ -400,7 +400,7 @@ int deque_set_at(deque me, int index, void *const data)
|
||||
* Since the data is being copied, the pointer only has to be valid when this
|
||||
* function is called.
|
||||
*
|
||||
* @param me the deque to set value of
|
||||
* @param me the deque to set the value of
|
||||
* @param data the data to set
|
||||
*
|
||||
* @return 0 if no error
|
||||
@@ -419,7 +419,7 @@ int deque_set_last(deque me, void *const data)
|
||||
* pointer only has to be valid when this function is called.
|
||||
*
|
||||
* @param data the data to set
|
||||
* @param me the deque to set value of
|
||||
* @param me the deque to set the value of
|
||||
*
|
||||
* @return 0 if no error
|
||||
* @return -EINVAL if invalid argument
|
||||
@@ -437,7 +437,7 @@ int deque_get_first(void *const data, deque me)
|
||||
* pointer, the pointer only has to be valid when this function is called.
|
||||
*
|
||||
* @param data the data to set
|
||||
* @param me the deque to set value of
|
||||
* @param me the deque to set the value of
|
||||
* @param index the index to set at
|
||||
*
|
||||
* @return 0 if no error
|
||||
@@ -468,7 +468,7 @@ int deque_get_at(void *const data, deque me, int index)
|
||||
* pointer only has to be valid when this function is called.
|
||||
*
|
||||
* @param data the data to set
|
||||
* @param me the deque to set value of
|
||||
* @param me the deque to set the value of
|
||||
*
|
||||
* @return 0 if no error
|
||||
* @return -EINVAL if invalid argument
|
||||
|
||||
@@ -61,11 +61,11 @@ forward_list forward_list_init(const size_t data_size)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the amount of elements in the singly-linked list.
|
||||
* Gets the number of elements in the singly-linked list.
|
||||
*
|
||||
* @param me the singly-linked list to check
|
||||
*
|
||||
* @return the amount of elements
|
||||
* @return the number of elements
|
||||
*/
|
||||
int forward_list_size(forward_list me)
|
||||
{
|
||||
@@ -107,7 +107,7 @@ void forward_list_copy_to_array(void *const arr, forward_list me)
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the node at the specified index.
|
||||
* Gets the node at the specified index.
|
||||
*/
|
||||
static struct node *forward_list_get_node_at(forward_list me, const int index)
|
||||
{
|
||||
|
||||
10
src/list.c
10
src/list.c
@@ -64,11 +64,11 @@ list list_init(const size_t data_size)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the amount of elements in the doubly-linked list.
|
||||
* Gets the number of elements in the doubly-linked list.
|
||||
*
|
||||
* @param me the doubly-linked list to check
|
||||
*
|
||||
* @return the amount of elements
|
||||
* @return the number of elements
|
||||
*/
|
||||
int list_size(list me)
|
||||
{
|
||||
@@ -110,7 +110,7 @@ void list_copy_to_array(void *const arr, list me)
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the node at index starting from the head.
|
||||
* Gets the node at index starting from the head.
|
||||
*/
|
||||
static struct node *list_get_node_from_head(list me, const int index)
|
||||
{
|
||||
@@ -123,7 +123,7 @@ static struct node *list_get_node_from_head(list me, const int index)
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the node at index starting from tail.
|
||||
* Gets the node at index starting from the tail.
|
||||
*/
|
||||
static struct node *list_get_node_from_tail(list me, const int index)
|
||||
{
|
||||
@@ -136,7 +136,7 @@ static struct node *list_get_node_from_tail(list me, const int index)
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the node at the specified index.
|
||||
* Gets the node at the specified index.
|
||||
*/
|
||||
static struct node *list_get_node_at(list me, const int index)
|
||||
{
|
||||
|
||||
@@ -498,7 +498,7 @@ int multimap_get_next(void *const value, multimap me)
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the amount of times the key appears in the multi-map. The pointer
|
||||
* Determines the number of times the key appears in the multi-map. The pointer
|
||||
* to the key being passed in should point to the key type which this multi-map
|
||||
* holds. For example, if this multi-map holds key integers, the key pointer
|
||||
* should be a pointer to an integer. Since the key is being copied, the pointer
|
||||
@@ -507,7 +507,7 @@ int multimap_get_next(void *const value, multimap me)
|
||||
* @param me the multi-map to check for the key
|
||||
* @param key the key to check
|
||||
*
|
||||
* @return the amount of times the key appears in the multi-map
|
||||
* @return the number of times the key appears in the multi-map
|
||||
*/
|
||||
int multimap_count(multimap me, void *const key)
|
||||
{
|
||||
@@ -736,7 +736,7 @@ static void multimap_remove_element(multimap me, struct node *const traverse)
|
||||
* Since the key and value are being copied, the pointer only has to be valid
|
||||
* when this function is called.
|
||||
*
|
||||
* @param me the multi-map to remove an key from
|
||||
* @param me the multi-map to remove a key from
|
||||
* @param key the key to remove
|
||||
* @param value the value to remove
|
||||
*
|
||||
|
||||
@@ -360,7 +360,7 @@ int unordered_map_contains(unordered_map me, void *const key)
|
||||
* the key pointer should be a pointer to an integer. Since the key is being
|
||||
* copied, the pointer only has to be valid when this function is called.
|
||||
*
|
||||
* @param me the unordered map to remove an key from
|
||||
* @param me the unordered map to remove a key from
|
||||
* @param key the key to remove
|
||||
*
|
||||
* @return 1 if the unordered map contained the key, otherwise 0
|
||||
|
||||
@@ -382,7 +382,7 @@ int unordered_multimap_get_next(void *const value, unordered_multimap me)
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the amount of times the key appears in the unordered multi-map.
|
||||
* Determines the number of times the key appears in the unordered multi-map.
|
||||
* The pointer to the key being passed in should point to the key type which
|
||||
* this unordered multi-map holds. For example, if this unordered multi-map
|
||||
* holds key integers, the key pointer should be a pointer to an integer. Since
|
||||
@@ -392,7 +392,7 @@ int unordered_multimap_get_next(void *const value, unordered_multimap me)
|
||||
* @param me the unordered multi-map to check for the key
|
||||
* @param key the key to check
|
||||
*
|
||||
* @return the amount of times the key appears in the unordered multi-map
|
||||
* @return the number of times the key appears in the unordered multi-map
|
||||
*/
|
||||
int unordered_multimap_count(unordered_multimap me, void *const key)
|
||||
{
|
||||
@@ -443,7 +443,7 @@ int unordered_multimap_contains(unordered_multimap me, void *const key)
|
||||
* should be a pointer to an integer. Since the key and value are being copied,
|
||||
* the pointer only has to be valid when this function is called.
|
||||
*
|
||||
* @param me the unordered multi-map to remove an key from
|
||||
* @param me the unordered multi-map to remove a key from
|
||||
* @param key the key to remove
|
||||
* @param value the value to remove
|
||||
*
|
||||
|
||||
@@ -312,7 +312,7 @@ int unordered_set_contains(unordered_set me, void *const key)
|
||||
* should be a pointer to an integer. Since the key is being copied, the pointer
|
||||
* only has to be valid when this function is called.
|
||||
*
|
||||
* @param me the unordered set to remove an key from
|
||||
* @param me the unordered set to remove a key from
|
||||
* @param key the key to remove
|
||||
*
|
||||
* @return 1 if the unordered set contained the key, otherwise 0
|
||||
|
||||
@@ -102,7 +102,7 @@ int vector_is_empty(vector me)
|
||||
|
||||
/*
|
||||
* Sets the space of the buffer. Assumes that size is at least the same as the
|
||||
* amount of items currently in the vector.
|
||||
* number of items currently in the vector.
|
||||
*/
|
||||
static int vector_set_space(vector me, const int size)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user