summaryrefslogtreecommitdiff
path: root/toxcore/list.h
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-07-07 21:40:17 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-07-08 19:03:52 +0000
commit2b49f803959cf47f81d1b49032f7c6f30ccc37f7 (patch)
treede26ad6da901c7d951e66745ee80545b71300abb /toxcore/list.h
parentebdc43285a4fdf1f9d76f8839a9ba572a35cbb80 (diff)
Rename `BS_LIST` to `BS_List` to follow the naming conventions.
`BS_LIST` would be a constant. `BS_List` is a type name.
Diffstat (limited to 'toxcore/list.h')
-rw-r--r--toxcore/list.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/toxcore/list.h b/toxcore/list.h
index 9ad8f44d..8c6ddbf3 100644
--- a/toxcore/list.h
+++ b/toxcore/list.h
@@ -34,7 +34,7 @@ typedef struct {
34 uint32_t element_size; //size of the elements 34 uint32_t element_size; //size of the elements
35 uint8_t *data; //array of elements 35 uint8_t *data; //array of elements
36 int *ids; //array of element ids 36 int *ids; //array of element ids
37} BS_LIST; 37} BS_List;
38 38
39/* Initialize a list, element_size is the size of the elements in the list and 39/* Initialize a list, element_size is the size of the elements in the list and
40 * initial_capacity is the number of elements the memory will be initially allocated for 40 * initial_capacity is the number of elements the memory will be initially allocated for
@@ -43,10 +43,10 @@ typedef struct {
43 * 1 : success 43 * 1 : success
44 * 0 : failure 44 * 0 : failure
45 */ 45 */
46int bs_list_init(BS_LIST *list, uint32_t element_size, uint32_t initial_capacity); 46int bs_list_init(BS_List *list, uint32_t element_size, uint32_t initial_capacity);
47 47
48/* Free a list initiated with list_init */ 48/* Free a list initiated with list_init */
49void bs_list_free(BS_LIST *list); 49void bs_list_free(BS_List *list);
50 50
51/* Retrieve the id of an element in the list 51/* Retrieve the id of an element in the list
52 * 52 *
@@ -54,7 +54,7 @@ void bs_list_free(BS_LIST *list);
54 * >= 0 : id associated with data 54 * >= 0 : id associated with data
55 * -1 : failure 55 * -1 : failure
56 */ 56 */
57int bs_list_find(const BS_LIST *list, const uint8_t *data); 57int bs_list_find(const BS_List *list, const uint8_t *data);
58 58
59/* Add an element with associated id to the list 59/* Add an element with associated id to the list
60 * 60 *
@@ -62,7 +62,7 @@ int bs_list_find(const BS_LIST *list, const uint8_t *data);
62 * 1 : success 62 * 1 : success
63 * 0 : failure (data already in list) 63 * 0 : failure (data already in list)
64 */ 64 */
65int bs_list_add(BS_LIST *list, const uint8_t *data, int id); 65int bs_list_add(BS_List *list, const uint8_t *data, int id);
66 66
67/* Remove element from the list 67/* Remove element from the list
68 * 68 *
@@ -70,7 +70,7 @@ int bs_list_add(BS_LIST *list, const uint8_t *data, int id);
70 * 1 : success 70 * 1 : success
71 * 0 : failure (element not found or id does not match) 71 * 0 : failure (element not found or id does not match)
72 */ 72 */
73int bs_list_remove(BS_LIST *list, const uint8_t *data, int id); 73int bs_list_remove(BS_List *list, const uint8_t *data, int id);
74 74
75/* Removes the memory overhead 75/* Removes the memory overhead
76 * 76 *
@@ -78,6 +78,6 @@ int bs_list_remove(BS_LIST *list, const uint8_t *data, int id);
78 * 1 : success 78 * 1 : success
79 * 0 : failure 79 * 0 : failure
80 */ 80 */
81int bs_list_trim(BS_LIST *list); 81int bs_list_trim(BS_List *list);
82 82
83#endif 83#endif