4
4
* This file is licensed by the GPL version 2. Works owned by the
5
5
* Transmission project are granted a special exemption to clause 2(b)
6
* so that the bulk of its code can remain under the MIT license.
6
* so that the bulk of its code can remain under the MIT license.
7
7
* This exemption does not extend to derived works not owned by
8
8
* the Transmission project.
10
* $Id: list.h 4404 2008-01-01 17:20:20Z charles $
10
* $Id: list.h 6795 2008-09-23 19:11:04Z charles $
16
16
typedef struct tr_list
19
19
struct tr_list * next;
20
20
struct tr_list * prev;
24
typedef int (*TrListCompareFunc)(const void * a, const void * b);
25
typedef void (*TrListForeachFunc)(void *);
27
int tr_list_size ( const tr_list * list );
29
void tr_list_free ( tr_list ** list,
30
TrListForeachFunc data_free_func );
32
void tr_list_append ( tr_list ** list,
35
void tr_list_prepend ( tr_list ** list,
38
void* tr_list_pop_front ( tr_list ** list );
40
void* tr_list_remove_data ( tr_list ** list,
43
void* tr_list_remove ( tr_list ** list,
45
TrListCompareFunc compare_func );
47
void tr_list_insert_sorted ( tr_list ** list,
49
TrListCompareFunc compare_func );
51
tr_list* tr_list_find ( tr_list * list,
53
TrListCompareFunc compare_func );
55
tr_list* tr_list_find_data ( tr_list * list,
58
void tr_list_foreach ( tr_list * list,
59
TrListForeachFunc foreach_func );
24
typedef int ( *TrListCompareFunc )( const void * a, const void * b );
25
typedef void ( *TrListForeachFunc )( void * );
27
int tr_list_size( const tr_list * list );
29
void tr_list_free( tr_list ** list,
30
TrListForeachFunc data_free_func );
32
void tr_list_append( tr_list ** list,
35
void tr_list_prepend( tr_list ** list,
38
void* tr_list_pop_front( tr_list ** list );
40
void* tr_list_remove_data( tr_list ** list,
43
void* tr_list_remove( tr_list ** list,
45
TrListCompareFunc compare_func );
47
void tr_list_insert_sorted( tr_list ** list,
49
TrListCompareFunc compare_func );
51
tr_list* tr_list_find( tr_list * list,
53
TrListCompareFunc compare_func );
55
tr_list* tr_list_find_data( tr_list * list,
58
void tr_list_foreach( tr_list * list,
59
TrListForeachFunc foreach_func );
61
61
#endif /* TR_LIST_H */