mirror of
https://github.com/transmission/transmission
synced 2024-12-26 09:37:56 +00:00
879a2afcbd
The Berne Convention says that the copyright year is moot, so instead of adding another year to each file as in previous years, I've removed the year altogether from the source code comments in libtransmission, gtk, qt, utils, daemon, and cli. Juliusz's copyright notice in tr-dht and Johannes' copyright notice in tr-lpd have been left alone; it didn't seem appropriate to modify them.
70 lines
1.9 KiB
C
70 lines
1.9 KiB
C
/*
|
|
* This file Copyright (C) Mnemosyne LLC
|
|
*
|
|
* This file is licensed by the GPL version 2. Works owned by the
|
|
* Transmission project are granted a special exemption to clause 2(b)
|
|
* so that the bulk of its code can remain under the MIT license.
|
|
* This exemption does not extend to derived works not owned by
|
|
* the Transmission project.
|
|
*
|
|
* $Id$
|
|
*/
|
|
|
|
#ifndef __TRANSMISSION__
|
|
#error only libtransmission should #include this header.
|
|
#endif
|
|
|
|
#ifndef TR_CACHE_H
|
|
#define TR_CACHE_H
|
|
|
|
typedef struct tr_cache tr_cache;
|
|
|
|
/***
|
|
****
|
|
***/
|
|
|
|
tr_cache * tr_cacheNew( int64_t max_bytes );
|
|
|
|
void tr_cacheFree( tr_cache * );
|
|
|
|
/***
|
|
****
|
|
***/
|
|
|
|
int tr_cacheSetLimit( tr_cache * cache, int64_t max_bytes );
|
|
|
|
int64_t tr_cacheGetLimit( const tr_cache * );
|
|
|
|
int tr_cacheWriteBlock( tr_cache * cache,
|
|
tr_torrent * torrent,
|
|
tr_piece_index_t piece,
|
|
uint32_t offset,
|
|
uint32_t len,
|
|
const uint8_t * writeme );
|
|
|
|
int tr_cacheReadBlock( tr_cache * cache,
|
|
tr_torrent * torrent,
|
|
tr_piece_index_t piece,
|
|
uint32_t offset,
|
|
uint32_t len,
|
|
uint8_t * setme );
|
|
|
|
int tr_cachePrefetchBlock( tr_cache * cache,
|
|
tr_torrent * torrent,
|
|
tr_piece_index_t piece,
|
|
uint32_t offset,
|
|
uint32_t len );
|
|
|
|
/***
|
|
****
|
|
***/
|
|
int tr_cacheFlushDone( tr_cache * cache );
|
|
|
|
int tr_cacheFlushTorrent( tr_cache * cache,
|
|
tr_torrent * torrent );
|
|
|
|
int tr_cacheFlushFile( tr_cache * cache,
|
|
tr_torrent * torrent,
|
|
tr_file_index_t file );
|
|
|
|
#endif
|