-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlist.h
More file actions
24 lines (19 loc) · 733 Bytes
/
list.h
File metadata and controls
24 lines (19 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef LIST_H__
#define LIST_H__
#include "node.h"
typedef struct Head Head;
typedef node_data_alloc_func list_data_alloc_func;
typedef node_data_dealloc_func list_data_dealloc_func;
typedef struct Config
{
list_data_alloc_func list_data_alloc_func_fptr;
list_data_dealloc_func list_data_dealloc_func_fptr;
} Config;
typedef void (*list_func)(void*, void*);
Head* create_list(Config* config);
void destroy_list(Head* head, void (*destroy_user_data_func)(void*, void*), void* user_args);
unsigned count_nodes(Head* head);
SLL_Result append_to_list(Head* head, unsigned size, void* data);
bool find_in_list(Head* head, void* item, bool (*compare_func)(void*, void*));
void set_config(Config* config);
#endif // LIST_H__