source: trunk/libtransmission/list.h @ 2310

Last change on this file since 2310 was 2310, checked in by charles, 15 years ago

fix r2306 double-free crash reported by Gimp_, webaake

File size: 1.2 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 );
26tr_list_t*  tr_list_pop         ( tr_list_t*, void ** setme );
27
28typedef int (*TrListCompareFunc)(const void * a, const void * b);
29tr_list_t*  tr_list_find        ( tr_list_t*, TrListCompareFunc func, const void * b );
30tr_list_t*  tr_list_find_data   ( tr_list_t*, const void * data );
31
32typedef void (*TrListForeachFunc)(void *);
33void tr_list_foreach            ( tr_list_t*, TrListForeachFunc func );
34
35#endif /* TR_LIST_H */
36
Note: See TracBrowser for help on using the repository browser.