Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 2fd1f7c34e
Fetching contributors…

Cannot retrieve contributors at this time

60 lines (44 sloc) 1.581 kB
#ifndef BTPD_TLIB_H
#define BTPD_TLIB_H
struct tlib {
unsigned num;
uint8_t hash[20];
struct torrent *tp;
char *name;
char *dir;
char *label;
unsigned long long tot_up, tot_down;
off_t content_size, content_have;
HTBL_ENTRY(nchain);
HTBL_ENTRY(hchain);
};
struct file_time_size {
off_t size;
time_t mtime;
};
void tlib_init(void);
struct tlib *tlib_iter_first(struct htbl_iter *it);
struct tlib *tlib_iter_next(struct htbl_iter *it);
struct tlib *tlib_add(const uint8_t *hash, const char *mi, size_t mi_size,
const char *content, char *name, char *label);
struct tlib *tlib_readd(struct tlib *tl, const uint8_t *hash, const char *mi,
size_t mi_size, const char *content, char *name, char *label);
int tlib_del(struct tlib *tl);
void tlib_kill(struct tlib *tl);
void tlib_update_info(struct tlib *tl, int only_file);
struct tlib *tlib_by_hash(const uint8_t *hash);
struct tlib *tlib_by_num(unsigned num);
unsigned tlib_count(void);
int tlib_load_mi(struct tlib *tl, char **res);
void tlib_read_hash(struct tlib *tl, size_t off, uint32_t piece,
uint8_t *hash);
struct resume_data *tlib_open_resume(struct tlib *tl, unsigned nfiles,
size_t pfsize, size_t bfsize);
void tlib_close_resume(struct resume_data *resume);
uint8_t *resume_piece_field(struct resume_data *resd);
uint8_t *resume_block_field(struct resume_data *resd);
void resume_set_fts(struct resume_data *resd, int i,
struct file_time_size *fts);
void resume_get_fts(struct resume_data *resd, int i,
struct file_time_size *fts);
#endif
Jump to Line
Something went wrong with that request. Please try again.