Skip to content

Commit

Permalink
Documentation fixes: "data"->"value".
Browse files Browse the repository at this point in the history
  • Loading branch information
fragglet committed Jun 1, 2008
1 parent 4eb8b90 commit ac6272d
Show file tree
Hide file tree
Showing 10 changed files with 157 additions and 150 deletions.
46 changes: 24 additions & 22 deletions src/arraylist.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ POSSIBILITY OF SUCH DAMAGE.
* To create an ArrayList, use @ref arraylist_new.
* To destroy an ArrayList, use @ref arraylist_free.
*
* To add data an ArrayList, use @ref arraylist_prepend,
* To add a value to an ArrayList, use @ref arraylist_prepend,
* @ref arraylist_append, or @ref arraylist_insert.
*
* To remove data from an ArrayList, use @ref arraylist_remove
* To remove a value from an ArrayList, use @ref arraylist_remove
* or @ref arraylist_remove_range.
*/

Expand Down Expand Up @@ -92,21 +92,22 @@ typedef struct _ArrayList {
* @return Non-zero if the values are not equal, zero if they are equal.
*/

typedef int (*ArrayListEqualFunc)(ArrayListValue data1, ArrayListValue data2);
typedef int (*ArrayListEqualFunc)(ArrayListValue value1, ArrayListValue value2);

/**
* Compare two values in an arraylist. Used by @ref arraylist_sort
* when sorting values.
*
* @param data1 The first value.
* @param data2 The second value.
* @return A negative number if data1 should be sorted
* before data2, a positive number if data2 should
* be sorted before data1, zero if the two values
* @param value1 The first value.
* @param value2 The second value.
* @return A negative number if value1 should be sorted
* before value2, a positive number if value2 should
* be sorted before value1, zero if the two values
* are equal.
*/

typedef int (*ArrayListCompareFunc)(ArrayListValue data1, ArrayListValue data2);
typedef int (*ArrayListCompareFunc)(ArrayListValue value1,
ArrayListValue value2);

/**
* Allocate a new ArrayList for use.
Expand All @@ -129,10 +130,10 @@ ArrayList *arraylist_new(int length);
void arraylist_free(ArrayList *arraylist);

/**
* Append data to the end of an ArrayList.
* Append a value to the end of an ArrayList.
*
* @param arraylist The ArrayList.
* @param data The data to append.
* @param data The value to append.
* @return Non-zero if the request was successful, zero
* if it was not possible to allocate more memory
* for the new entry.
Expand All @@ -141,10 +142,10 @@ void arraylist_free(ArrayList *arraylist);
int arraylist_append(ArrayList *arraylist, ArrayListValue data);

/**
* Prepend data to the beginning of an ArrayList.
* Prepend a value to the beginning of an ArrayList.
*
* @param arraylist The ArrayList.
* @param data The data to prepend.
* @param data The value to prepend.
* @return Non-zero if the request was successful, zero
* if it was not possible to allocate more memory
* for the new entry.
Expand Down Expand Up @@ -172,13 +173,13 @@ void arraylist_remove(ArrayList *arraylist, int index);
void arraylist_remove_range(ArrayList *arraylist, int index, int length);

/**
* Insert new data at the specified index in an ArrayList.
* The index where new data can be inserted is limited by the
* Insert a value at the specified index in an ArrayList.
* The index where the new value can be inserted is limited by the
* size of the ArrayList.
*
* @param arraylist The ArrayList.
* @param index The index at which to insert the data.
* @param data The data.
* @param index The index at which to insert the value.
* @param data The value.
* @return Returns zero if unsuccessful, else non-zero
* if successful (due to an invalid index or
* if it was impossible to allocate more memory).
Expand All @@ -187,13 +188,14 @@ void arraylist_remove_range(ArrayList *arraylist, int index, int length);
int arraylist_insert(ArrayList *arraylist, int index, ArrayListValue data);

/**
* Find the index of a particular pointer in an ArrayList.
* Find the index of a particular value in an ArrayList.
*
* @param arraylist The ArrayList to search.
* @param callback Callback function to be invoked to determine if
* values are equal to the data to search for.
* @param data The data to search for.
* @return The index of the data if found, or -1 if not found.
* @param callback Callback function to be invoked to compare
* values in the list with the value to be
* searched for.
* @param data The value to search for.
* @return The index of the value if found, or -1 if not found.
*/

int arraylist_index_of(ArrayList *arraylist,
Expand Down
14 changes: 7 additions & 7 deletions src/avl-tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ typedef struct _AVLTreeNode AVLTreeNode;
/**
* Type of function used to compare keys in an AVL tree.
*
* @param data1 The first key.
* @param data2 The second key.
* @return A negative number if data1 should be sorted
* before data2, a positive number if data2 should
* be sorted before data1, zero if the two keys
* @param value1 The first key.
* @param value2 The second key.
* @return A negative number if value1 should be sorted
* before value2, a positive number if value2 should
* be sorted before value1, zero if the two keys
* are equal.
*/

typedef int (*AVLTreeCompareFunc)(AVLTreeValue data1, AVLTreeValue data2);
typedef int (*AVLTreeCompareFunc)(AVLTreeValue value1, AVLTreeValue value2);

/**
* Create a new AVL tree.
Expand Down Expand Up @@ -199,7 +199,7 @@ AVLTreeNode *avl_tree_lookup_node(AVLTree *tree, AVLTreeKey key);
* @param tree The AVL tree to search.
* @param key The key to search for.
* @return The value associated with the given key, or
* AVLTREE_NULL if no entry with the given key is
* @ref AVLTREE_NULL if no entry with the given key is
* found.
*/

Expand Down
14 changes: 8 additions & 6 deletions src/binary-heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,15 @@ typedef void *BinaryHeapValue;
/**
* Type of function used to compare values in a binary heap.
*
* @param data1 The first value.
* @param data2 The second value.
* @return A negative number if data1 is less than data2,
* a positive number if data1 is greater than data2,
* @param value1 The first value.
* @param value2 The second value.
* @return A negative number if value1 is less than value2,
* a positive number if value1 is greater than value2,
* zero if the two are equal.
*/

typedef int (*BinaryHeapCompareFunc)(BinaryHeapValue data1, BinaryHeapValue data2);
typedef int (*BinaryHeapCompareFunc)(BinaryHeapValue value1,
BinaryHeapValue value2);

/**
* A binary heap data structure.
Expand Down Expand Up @@ -137,7 +138,8 @@ int binary_heap_insert(BinaryHeap *heap, BinaryHeapValue value);
* Remove the first value from a binary heap.
*
* @param heap The heap.
* @return The first value in the heap.
* @return The first value in the heap, or
* @ref BINARY_HEAP_NULL if the heap is empty.
*/

BinaryHeapValue binary_heap_pop(BinaryHeap *heap);
Expand Down
15 changes: 8 additions & 7 deletions src/binomial-heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ typedef void *BinomialHeapValue;
/**
* Type of function used to compare values in a binomial heap.
*
* @param data1 The first value.
* @param data2 The second value.
* @return A negative number if data1 is less than data2,
* a positive number if data1 is greater than data2,
* @param value1 The first value.
* @param value2 The second value.
* @return A negative number if value1 is less than value2,
* a positive number if value1 is greater than value2,
* zero if the two are equal.
*/

typedef int (*BinomialHeapCompareFunc)(BinomialHeapValue data1,
BinomialHeapValue data2);
typedef int (*BinomialHeapCompareFunc)(BinomialHeapValue value1,
BinomialHeapValue value2);

/**
* A binomial heap data structure.
Expand Down Expand Up @@ -138,7 +138,8 @@ int binomial_heap_insert(BinomialHeap *heap, BinomialHeapValue value);
* Remove the first value from a binomial heap.
*
* @param heap The heap.
* @return The first value in the heap.
* @return The first value in the heap, or
* @ref BINOMIAL_HEAP_NULL if the heap is empty.
*/

BinomialHeapValue binomial_heap_pop(BinomialHeap *heap);
Expand Down
10 changes: 5 additions & 5 deletions src/hash-table.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ struct _HashTableIterator {
* Hash function used to generate hash values for keys used in a hash
* table.
*
* @param data The value to generate a hash value for.
* @param value The value to generate a hash value for.
* @return The hash value.
*/

typedef unsigned long (*HashTableHashFunc)(HashTableKey data);
typedef unsigned long (*HashTableHashFunc)(HashTableKey value);

/**
* Function used to compare two keys for equality.
Expand All @@ -127,21 +127,21 @@ typedef unsigned long (*HashTableHashFunc)(HashTableKey data);
* not equal.
*/

typedef int (*HashTableEqualFunc)(HashTableKey data1, HashTableKey data2);
typedef int (*HashTableEqualFunc)(HashTableKey value1, HashTableKey value2);

/**
* Type of function used to free keys when entries are removed from a
* hash table.
*/

typedef void (*HashTableKeyFreeFunc)(HashTableKey data);
typedef void (*HashTableKeyFreeFunc)(HashTableKey value);

/**
* Type of function used to free values when entries are removed from a
* hash table.
*/

typedef void (*HashTableValueFreeFunc)(HashTableValue data);
typedef void (*HashTableValueFreeFunc)(HashTableValue value);

/**
* Create a new hash table.
Expand Down
68 changes: 34 additions & 34 deletions src/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ POSSIBILITY OF SUCH DAMAGE.
* a @ref ListEntry structure, and initialise it to NULL.
* To destroy an entire list, use @ref list_free.
*
* To add data to a list, use @ref list_append or @ref list_prepend.
* To add a value to a list, use @ref list_append or @ref list_prepend.
*
* To remove data from a list, use @ref list_remove_entry or
* To remove a value from a list, use @ref list_remove_entry or
* @ref list_remove_data.
*
* To iterate over entries in a list, use @ref list_iterate to initialise
Expand Down Expand Up @@ -107,26 +107,26 @@ struct _ListIterator {
/**
* Callback function used to compare values in a list when sorting.
*
* @param data1 The first value to compare.
* @param data2 The second value to compare.
* @return A negative value if data1 should be sorted before
* data2, a positive value if data1 should be sorted
* after data2, zero if data1 and data2 are equal.
* @param value1 The first value to compare.
* @param value2 The second value to compare.
* @return A negative value if value1 should be sorted before
* value2, a positive value if value1 should be sorted
* after value2, zero if value1 and value2 are equal.
*/

typedef int (*ListCompareFunc)(ListValue data1, ListValue data2);
typedef int (*ListCompareFunc)(ListValue value1, ListValue value2);

/**
* Callback function used to determine of two values in a list are
* equal.
*
* @param data1 The first value to compare.
* @param data2 The second value to compare.
* @return A non-zero value if data1 and data2 are equal, zero
* @param value1 The first value to compare.
* @param value2 The second value to compare.
* @return A non-zero value if value1 and value2 are equal, zero
* if they are not equal.
*/

typedef int (*ListEqualFunc)(ListValue data1, ListValue data2);
typedef int (*ListEqualFunc)(ListValue value1, ListValue value2);

/**
* Free an entire list.
Expand All @@ -137,23 +137,23 @@ typedef int (*ListEqualFunc)(ListValue data1, ListValue data2);
void list_free(ListEntry *list);

/**
* Prepend data to the start of a list.
* Prepend a value to the start of a list.
*
* @param list Pointer to the list to prepend to.
* @param data Data to prepend.
* @return The new entry in the list, or NULL if it was not possible
* to allocate the memory for the new entry.
* @param data The value to prepend.
* @return The new entry in the list, or NULL if it was not
* possible to allocate the memory for the new entry.
*/

ListEntry *list_prepend(ListEntry **list, ListValue data);

/**
* Append data to the end of a list.
* Append a value to the end of a list.
*
* @param list Pointer to the list to append to.
* @param data Data to append.
* @return The new entry in the list, or NULL if it was not possible
* to allocate the memory for the new entry.
* @param value The value to append.
* @return The new entry in the list, or NULL if it was not
* possible to allocate the memory for the new entry.
*/

ListEntry *list_append(ListEntry **list, ListValue data);
Expand All @@ -179,10 +179,10 @@ ListEntry *list_prev(ListEntry *listentry);
ListEntry *list_next(ListEntry *listentry);

/**
* Retrieve the data at a list entry.
* Retrieve the value at a list entry.
*
* @param listentry Pointer to the list entry.
* @return The data at the list entry.
* @return The value stored at the list entry.
*/

ListValue list_data(ListEntry *listentry);
Expand All @@ -198,11 +198,11 @@ ListValue list_data(ListEntry *listentry);
ListEntry *list_nth_entry(ListEntry *list, int n);

/**
* Retrieve the data at a specified entry in the list.
* Retrieve the value at a specified index in the list.
*
* @param list The list.
* @param n The index into the list .
* @return The data at the specified index, or LIST_NULL if
* @param n The index into the list.
* @return The value at the specified index, or @ref LIST_NULL if
* unsuccessful.
*/

Expand Down Expand Up @@ -241,12 +241,12 @@ ListValue *list_to_array(ListEntry *list);
int list_remove_entry(ListEntry **list, ListEntry *entry);

/**
* Remove all occurrences of a particular piece of data from a list.
* Remove all occurrences of a particular value from a list.
*
* @param list Pointer to the list.
* @param callback Function to invoke to compare data against the
* data to be removed.
* @param data The data to remove from the list.
* @param callback Function to invoke to compare values in the list
* with the value to be removed.
* @param data The value to remove from the list.
* @return The number of entries removed from the list.
*/

Expand All @@ -262,12 +262,12 @@ int list_remove_data(ListEntry **list, ListEqualFunc callback, ListValue data);
void list_sort(ListEntry **list, ListCompareFunc compare_func);

/**
* Find the entry for a particular data item in a list.
* Find the entry for a particular value in a list.
*
* @param list The list to search.
* @param callback Callback function to be invoked to determine if
* values are equal to the data to search for.
* @param data The data to search for.
* @param callback Function to invoke to compare values in the list
* with the value to be searched for.
* @param data The value to search for.
* @return The list entry of the item being searched for, or
* NULL if not found.
*/
Expand Down Expand Up @@ -300,7 +300,7 @@ int list_iter_has_more(ListIterator *iterator);
* Using a list iterator, retrieve the next value from the list.
*
* @param iterator The list iterator.
* @return The next value from the list, or LIST_NULL if
* @return The next value from the list, or @ref LIST_NULL if
* there are no more values in the list.
*/

Expand Down
Loading

0 comments on commit ac6272d

Please sign in to comment.