diff options
| author | Richard Nyberg <rnyberg@murmeldjur.se> | 2006-02-05 17:08:39 +0000 |
|---|---|---|
| committer | Richard Nyberg <rnyberg@murmeldjur.se> | 2006-02-05 17:08:39 +0000 |
| commit | 01c92051d5eda1c5fe44c7a84766afbd6774ff24 (patch) | |
| tree | fcf31e1029b3e0590393ca32ed03a21d0df262e9 /cli/btpd_if.h | |
| parent | 6559fcb9a42e241979e845bb574bdf3b38e03b90 (diff) | |
| download | btpd-01c92051d5eda1c5fe44c7a84766afbd6774ff24.tar.gz btpd-01c92051d5eda1c5fe44c7a84766afbd6774ff24.zip | |
o Changed the benc_ api to make it easier to use.
o Lot of work on the cli and its communication with btpd.
Diffstat (limited to 'cli/btpd_if.h')
| -rw-r--r-- | cli/btpd_if.h | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/cli/btpd_if.h b/cli/btpd_if.h index e67770f..64cdb4b 100644 --- a/cli/btpd_if.h +++ b/cli/btpd_if.h @@ -5,17 +5,40 @@ #include <sys/socket.h> #include <sys/un.h> -struct ipc { - struct sockaddr_un addr; +struct ipc; + +enum ipc_code { + IPC_OK, + IPC_FAIL, + IPC_COMMERR +}; + +struct btstat { + unsigned ntorrents; + struct tpstat { + char *name; + unsigned num; + char state; + + unsigned errors; + unsigned npeers; + uint32_t npieces, nseen; + off_t have, total; + long long downloaded, uploaded; + unsigned long rate_up, rate_down; + } torrents[]; }; -int ipc_open(const char *key, struct ipc **out); +int ipc_open(const char *dir, struct ipc **out); int ipc_close(struct ipc *ipc); -int btpd_add(struct ipc *ipc, char **path, unsigned npaths, char **out); -int btpd_del(struct ipc *ipc, uint8_t (*hash)[20], - unsigned nhashes, char **out); -int btpd_die(struct ipc *ipc); -int btpd_stat(struct ipc *ipc, char **out); +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 |