From 2550d6cb8c7f263f63a68122b69285f8f849dc18 Mon Sep 17 00:00:00 2001 From: Richard Nyberg Date: Wed, 8 Feb 2006 22:56:35 +0000 Subject: Interaction with btpd is now much more like I want it. Previous work has moved toward btpd having a library of torrent to wich one may add or remove torrents, and where interaction on torrents are done by their assigned number. This commit is a step back from that and it makes life simpler and better for all :) * Some options to btpd has changed: --no-daemon is the old -d. -d is now used to specify the btpd directory. --logfile option is reintroduced. * The ipc code has been improved on both btpd and cli sides. * All commands have been implemented. * Various improvements in btpd. With this commit we're very close to 0.8 :) --- cli/btpd_if.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'cli/btpd_if.h') diff --git a/cli/btpd_if.h b/cli/btpd_if.h index 64cdb4b..8c35cc7 100644 --- a/cli/btpd_if.h +++ b/cli/btpd_if.h @@ -1,15 +1,18 @@ #ifndef BTPD_IF_H #define BTPD_IF_H -#include -#include -#include - struct ipc; +enum torrent_state { //XXX: Same as in btpd/torrent.h + T_STARTING, + T_ACTIVE, + T_STOPPING +}; + enum ipc_code { IPC_OK, IPC_FAIL, + IPC_ERROR, IPC_COMMERR }; @@ -17,8 +20,7 @@ struct btstat { unsigned ntorrents; struct tpstat { char *name; - unsigned num; - char state; + enum torrent_state state; unsigned errors; unsigned npeers; @@ -32,13 +34,11 @@ struct btstat { int ipc_open(const char *dir, struct ipc **out); int ipc_close(struct ipc *ipc); +enum ipc_code btpd_add(struct ipc *ipc, const uint8_t *hash, + const char *torrent, const char *content); +enum ipc_code btpd_del(struct ipc *ipc, const uint8_t *hash); enum ipc_code btpd_die(struct ipc *ipc, int seconds); enum ipc_code btpd_stat(struct ipc *ipc, struct btstat **out); - -enum ipc_code btpd_del_num(struct ipc *ipc, unsigned num); -enum ipc_code btpd_start_num(struct ipc *ipc, unsigned num); -enum ipc_code btpd_stop_num(struct ipc *ipc, unsigned num); - void free_btstat(struct btstat *stat); #endif -- cgit 1.4.1