2009-05-03 14:20:03 +02:00
|
|
|
#ifndef _TORRENTFILE_H_
|
|
|
|
#define _TORRENTFILE_H_
|
|
|
|
|
|
|
|
#include "list.h"
|
|
|
|
#include "spawn.h"
|
|
|
|
|
|
|
|
extern struct list_head torrent_list;
|
|
|
|
|
|
|
|
struct torrent_file {
|
|
|
|
/* list of torrent files */
|
|
|
|
struct list_head list;
|
|
|
|
|
|
|
|
/* list of clients in this cloud */
|
|
|
|
struct list_head client_list;
|
|
|
|
|
|
|
|
/* name of torrentfile */
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
/* local seeder process */
|
|
|
|
struct child_process *child;
|
|
|
|
|
|
|
|
/* destroy torrent after child-exit */
|
|
|
|
int destroy;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct torrent_file * find_create_torrent(const char *fullpath);
|
|
|
|
int destroy_torrent(struct torrent_file *torrent);
|
|
|
|
|
|
|
|
int seed_torrent(struct torrent_file *torrent);
|
|
|
|
|
2009-05-04 14:42:29 +02:00
|
|
|
int torrentfile_init(void);
|
|
|
|
|
2009-05-03 14:20:03 +02:00
|
|
|
#endif /* _TORRENTFILE_H_ */
|