source: trunk/libtransmission/list.h @ 2552

Last change on this file since 2552 was 2552, checked in by charles, 14 years ago

better encapsulation of platform-specific constructs: tr_thread_t, tr_cond_t, tr_lock_t

File size: 1.1 KB
Line 
1/*
2 * This file Copyright (C) 2007 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
11#ifndef TR_LIST_H
12#define TR_LIST_H
13
14typedef struct tr_list_s
15{
16    void              * data;
17    struct tr_list_s  * next;
18    struct tr_list_s  * prev;
19}
20tr_list_t;
21
22void        tr_list_free        ( tr_list_t* );
23tr_list_t*  tr_list_append      ( tr_list_t*, void * data );
24tr_list_t*  tr_list_prepend     ( tr_list_t*, void * data );
25tr_list_t*  tr_list_remove_data ( tr_list_t*, const void * data );
26
27typedef int (*TrListCompareFunc)(const void * a, const void * b);
28tr_list_t*  tr_list_find        ( tr_list_t*, TrListCompareFunc func, const void * b );
29tr_list_t*  tr_list_find_data   ( tr_list_t*, const void * data );
30
31typedef void (*TrListForeachFunc)(void *);
32void tr_list_foreach            ( tr_list_t*, TrListForeachFunc func );
33
34#endif /* TR_LIST_H */
35
Note: See TracBrowser for help on using the repository browser.