source: trunk/libtransmission/list.h @ 6795

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

run libT, cli, daemon, gtk through the source-code formatter "uncrustify" as promised/threatened

  • Property svn:keywords set to Date Rev Author Id
File size: 1.8 KB
Line 
1/*
2 * This file Copyright (C) 2007-2008 Charles Kerr <charles@rebelbase.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 6795 2008-09-23 19:11:04Z charles $
11 */
12
13#ifndef TR_LIST_H
14#define TR_LIST_H
15
16typedef struct tr_list
17{
18    void *  data;
19    struct tr_list  * next;
20    struct tr_list  * prev;
21}
22tr_list;
23
24typedef int ( *TrListCompareFunc )( const void * a, const void * b );
25typedef void ( *TrListForeachFunc )( void * );
26
27int      tr_list_size( const tr_list * list );
28
29void     tr_list_free( tr_list **        list,
30                       TrListForeachFunc data_free_func );
31
32void     tr_list_append( tr_list ** list,
33                         void *     data );
34
35void     tr_list_prepend( tr_list ** list,
36                          void *     data );
37
38void*    tr_list_pop_front( tr_list ** list );
39
40void*    tr_list_remove_data( tr_list **   list,
41                              const void * data );
42
43void*    tr_list_remove( tr_list **        list,
44                         const void *      b,
45                         TrListCompareFunc compare_func );
46
47void     tr_list_insert_sorted( tr_list **        list,
48                                void *            data,
49                                TrListCompareFunc compare_func );
50
51tr_list* tr_list_find( tr_list *         list,
52                       const void *      b,
53                       TrListCompareFunc compare_func );
54
55tr_list* tr_list_find_data( tr_list *    list,
56                            const void * data );
57
58void     tr_list_foreach( tr_list *         list,
59                          TrListForeachFunc foreach_func );
60
61#endif /* TR_LIST_H */
62
Note: See TracBrowser for help on using the repository browser.