source: trunk/libtransmission/ptrarray.h @ 4404

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

set copyright info to 2008

  • Property svn:keywords set to Date Rev Author Id
File size: 1.7 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: ptrarray.h 4404 2008-01-01 17:20:20Z charles $
11 */
12
13#ifndef _TR_POINTERS_H_
14#define _TR_POINTERS_H_
15
16/**
17 * A simple pointer array that resizes itself dynamically.
18 */
19typedef struct tr_ptrArray tr_ptrArray;
20
21typedef void (*PtrArrayForeachFunc)(void *);
22
23tr_ptrArray * tr_ptrArrayNew     ( void );
24tr_ptrArray * tr_ptrArrayDup     ( tr_ptrArray* );
25void    tr_ptrArrayForeach       ( tr_ptrArray*, PtrArrayForeachFunc func );
26void    tr_ptrArrayFree          ( tr_ptrArray*, PtrArrayForeachFunc func );
27void*   tr_ptrArrayNth           ( tr_ptrArray*, int n );
28void**  tr_ptrArrayPeek          ( tr_ptrArray*, int * size );
29void**  tr_ptrArrayBase          ( tr_ptrArray* );
30void    tr_ptrArrayClear         ( tr_ptrArray* );
31int     tr_ptrArrayInsert        ( tr_ptrArray*, void*, int pos );
32int     tr_ptrArrayAppend        ( tr_ptrArray*, void* );
33void    tr_ptrArrayErase         ( tr_ptrArray*, int begin, int end );
34int     tr_ptrArraySize          ( const tr_ptrArray* );
35int     tr_ptrArrayEmpty         ( const tr_ptrArray* );
36int     tr_ptrArrayInsertSorted  ( tr_ptrArray*, void*,
37                                   int compare(const void*,const void*) );
38void*   tr_ptrArrayRemoveSorted  ( tr_ptrArray*, void*,
39                                   int compare(const void*,const void*) );
40void*   tr_ptrArrayFindSorted    ( tr_ptrArray*, const void*,
41                                   int compare(const void*,const void*) );
42
43#endif
Note: See TracBrowser for help on using the repository browser.