modified: n.fq
[GalaxyCodeBases.git] / tools / torrent / mktorrent_crc / mktorrent.h
blob007526d2ecc4d33d5d4253010d90d3136b6946bc
1 #ifndef _MKTORRENT_H
2 #define _MKTORRENT_H
4 #ifdef _WIN32
5 #define DIRSEP "\\"
6 #define DIRSEP_CHAR '\\'
7 #else
8 #define DIRSEP "/"
9 #define DIRSEP_CHAR '/'
10 #endif
12 /* string list */
13 struct slist_s;
14 typedef struct slist_s slist_t;
15 struct slist_s {
16 char *s;
17 slist_t *next;
20 /* list of string lists */
21 struct llist_s;
22 typedef struct llist_s llist_t;
23 struct llist_s {
24 slist_t *l;
25 llist_t *next;
28 /* file list */
29 struct flist_s;
30 typedef struct flist_s flist_t;
31 struct flist_s {
32 char *path;
33 char hash[9];
34 off_t size;
35 flist_t *next;
38 typedef struct {
39 /* options */
40 unsigned int piece_length; /* piece length */
41 llist_t *announce_list; /* announce URLs */
42 char *comment; /* optional comment */
43 const char *torrent_name; /* name of torrent (name of directory) */
44 char *metainfo_file_path; /* absolute path to the metainfo file */
45 slist_t *web_seed_list; /* web seed URLs */
46 int target_is_directory; /* target is a directory */
47 int no_creation_date; /* don't write the creation date */
48 int private; /* set the private flag */
49 int verbose; /* be verbose */
50 #ifdef USE_PTHREADS
51 unsigned int threads; /* number of threads used for hashing */
52 #endif
54 /* information calculated by read_dir() */
55 off_t size; /* combined size of all files */
56 flist_t *file_list; /* list of files and their sizes */
57 unsigned int pieces; /* number of pieces */
58 } metafile_t;
60 #endif /* _MKTORRENT_H */