blob: 242bab3eb4d04cb1e8d9e9d1390e68687c10be87 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#ifndef BTPD_METAINFO_H
#define BTPD_METAINFO_H
struct fileinfo {
char *path;
off_t length;
};
struct metainfo {
char *name;
char *announce;
uint8_t info_hash[20];
uint8_t (*piece_hash)[20];
unsigned pieces_off;
uint32_t npieces;
off_t piece_length;
off_t total_length;
unsigned nfiles;
struct fileinfo *files;
};
int fill_fileinfo(const char *fdct, struct fileinfo *fip);
int fill_metainfo(const char *base, struct metainfo *mip, int mem_hashes);
void clear_metainfo(struct metainfo *mip);
void print_metainfo(struct metainfo *mip);
int load_metainfo(const char *path, off_t size, int mem_hashes, struct metainfo **res);
#endif
|