source: trunk/libtransmission/list.h @ 7404

Last change on this file since 7404 was 7404, checked in by charles, 13 years ago

updated email address

  • Property svn:keywords set to Date Rev Author Id
File size: 1.9 KB
Line 
1/*
2 * This file Copyright (C) 2007-2008 Charles Kerr <charles@transmissionbt.com>
3 *
4 * This file is licensed by the GPL version 2.  Works owned by the
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.
7 * This exemption does not extend to derived works not owned by
8 * the Transmission project.
9 *
10 * $Id: list.h 7404 2008-12-16 00:20:44Z charles $
11 */
12
13#ifndef __TRANSMISSION__
14#error only libtransmission should #include this header.
15#endif
16
17#ifndef TR_LIST_H
18#define TR_LIST_H
19
20typedef struct tr_list
21{
22    void *  data;
23    struct tr_list  * next;
24    struct tr_list  * prev;
25}
26tr_list;
27
28typedef int ( *TrListCompareFunc )( const void * a, const void * b );
29typedef void ( *TrListForeachFunc )( void * );
30
31int      tr_list_size( const tr_list * list );
32
33void     tr_list_free( tr_list **        list,
34                       TrListForeachFunc data_free_func );
35
36void     tr_list_append( tr_list ** list,
37                         void *     data );
38
39void     tr_list_prepend( tr_list ** list,
40                          void *     data );
41
42void*    tr_list_pop_front( tr_list ** list );
43
44void*    tr_list_remove_data( tr_list **   list,
45                              const void * data );
46
47void*    tr_list_remove( tr_list **        list,
48                         const void *      b,
49                         TrListCompareFunc compare_func );
50
51void     tr_list_insert_sorted( tr_list **        list,
52                                void *            data,
53                                TrListCompareFunc compare_func );
54
55tr_list* tr_list_find( tr_list *         list,
56                       const void *      b,
57                       TrListCompareFunc compare_func );
58
59tr_list* tr_list_find_data( tr_list *    list,
60                            const void * data );
61
62void     tr_list_foreach( tr_list *         list,
63                          TrListForeachFunc foreach_func );
64
65#endif /* TR_LIST_H */
66
Note: See TracBrowser for help on using the repository browser.