~ubuntu-branches/ubuntu/jaunty/transmission/jaunty-security

« back to all changes in this revision

Viewing changes to libtransmission/request-list.h

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Starr-Bochicchio, Andrew Starr-Bochicchio, Martin Pitt
  • Date: 2009-02-26 11:55:50 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20090226115550-3rnhgt9qhe3y6g74
Tags: 1.50-1ubuntu1
[ Andrew Starr-Bochicchio ]
* Merge from debian unstable (LP: #329161), remaining changes:
 - debian/control: 
  + Added replaces & provides clutch (now included as part of transmission).
  + Build-depends on quilt.
 - debian/rules: 
  + Uncommented "include /usr/share/quilt/quilt.make".
  + Added patch/unpatch targets for Quilt.
  + Create a PO template during package build.
 - 20_add_X-Ubuntu-Gettext-Domain.diff: Add X-Ubuntu-Gettext-Domain 
   to .desktop file.

[ Martin Pitt ]
* Add 01_check_notification_actions.diff: Check if notification
  agent supports actions, and do not use actions if not. (LP: #334252)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file Copyright (C) 2007-2009 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:$
 
11
 */
 
12
 
 
13
#ifndef __TRANSMISSION__
 
14
#error only libtransmission should #include this header.
 
15
#endif
 
16
 
 
17
#ifndef TR_PEER_REQ_H
 
18
#define TR_PEER_REQ_H
 
19
 
 
20
#include <inttypes.h>
 
21
 
 
22
struct peer_request
 
23
{
 
24
    uint32_t    index;
 
25
    uint32_t    offset;
 
26
    uint32_t    length;
 
27
    time_t      time_requested;
 
28
};
 
29
 
 
30
struct request_list
 
31
{
 
32
    size_t                 len;
 
33
    size_t                 max;
 
34
    struct peer_request  * fifo;
 
35
    struct peer_request  * sort;
 
36
};
 
37
 
 
38
extern const struct request_list REQUEST_LIST_INIT;
 
39
 
 
40
void reqListClear( struct request_list * list );
 
41
 
 
42
void reqListCopy( struct request_list * dest, const struct request_list * src );
 
43
 
 
44
/* O(log(N)) */
 
45
tr_bool reqListHas( const struct request_list * list, const struct peer_request * key );
 
46
 
 
47
/* O(log(N) + 1) */
 
48
void reqListAppend( struct request_list * list, const struct peer_request * req );
 
49
 
 
50
/* O(log(N) + 1) */
 
51
tr_bool reqListPop( struct request_list * list, struct peer_request * setme );
 
52
 
 
53
/* O(N + log(N)) */
 
54
tr_bool reqListRemove( struct request_list * list, const struct peer_request * key );
 
55
 
 
56
 
 
57
#endif