diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-07-07 21:40:17 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-07-08 19:03:52 +0000 |
commit | 2b49f803959cf47f81d1b49032f7c6f30ccc37f7 (patch) | |
tree | de26ad6da901c7d951e66745ee80545b71300abb /toxcore/list.h | |
parent | ebdc43285a4fdf1f9d76f8839a9ba572a35cbb80 (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.h | 14 |
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 | */ |
46 | int bs_list_init(BS_LIST *list, uint32_t element_size, uint32_t initial_capacity); | 46 | int 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 */ |
49 | void bs_list_free(BS_LIST *list); | 49 | void 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 | */ |
57 | int bs_list_find(const BS_LIST *list, const uint8_t *data); | 57 | int 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 | */ |
65 | int bs_list_add(BS_LIST *list, const uint8_t *data, int id); | 65 | int 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 | */ |
73 | int bs_list_remove(BS_LIST *list, const uint8_t *data, int id); | 73 | int 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 | */ |
81 | int bs_list_trim(BS_LIST *list); | 81 | int bs_list_trim(BS_List *list); |
82 | 82 | ||
83 | #endif | 83 | #endif |