feat!: make all functions have return values
This commit is contained in:
12
ds.h
12
ds.h
@@ -46,8 +46,9 @@ ds_dll_t *ds_dll_new_node(void *data);
|
||||
*
|
||||
* @param ll singly linked list
|
||||
* @param data data you want to add
|
||||
* @return 0 on success
|
||||
*/
|
||||
void ds_sll_insert(ds_sll_t *ll, void *data);
|
||||
int ds_sll_insert(ds_sll_t *ll, void *data);
|
||||
|
||||
/**
|
||||
* @brief data to insert into a doubly linked list. This will use
|
||||
@@ -55,8 +56,9 @@ void ds_sll_insert(ds_sll_t *ll, void *data);
|
||||
*
|
||||
* @param ll doubly linked list
|
||||
* @param data data you want to add
|
||||
* @return 0 on success
|
||||
*/
|
||||
void ds_dll_insert(ds_dll_t *ll, void *data);
|
||||
int ds_dll_insert(ds_dll_t *ll, void *data);
|
||||
|
||||
/**
|
||||
* @brief remove an index from a singly linked list
|
||||
@@ -88,8 +90,9 @@ ds_hmp_t *ds_hmp_init(int data_len);
|
||||
* @brief free all data allocated by ds_hmp_init and ds_hmp_insert
|
||||
*
|
||||
* @param hmp pointer to the hashmap
|
||||
* @return 0 on success
|
||||
*/
|
||||
void ds_hmp_free(ds_hmp_t **hmp, void kv_callback(_ds_hmp_kv_t *kv));
|
||||
int ds_hmp_free(ds_hmp_t **hmp, void kv_callback(_ds_hmp_kv_t *kv));
|
||||
|
||||
/**
|
||||
* @brief generate a numerical hash from a given string. You shouldn't need to
|
||||
@@ -107,8 +110,9 @@ int _ds_hmp_gen_hash(char *str);
|
||||
* @param hmp the hashmap to insert into
|
||||
* @param key the key
|
||||
* @param data the data
|
||||
* @return 0 on success
|
||||
*/
|
||||
void ds_hmp_insert(ds_hmp_t *hmp, char *key, void *data);
|
||||
int ds_hmp_insert(ds_hmp_t *hmp, char *key, void *data);
|
||||
|
||||
/**
|
||||
* @brief get something from a hashmap using it's key
|
||||
|
Reference in New Issue
Block a user