diff options
| author | Richard Nyberg <rnyberg@murmeldjur.se> | 2006-09-13 07:02:07 +0000 |
|---|---|---|
| committer | Richard Nyberg <rnyberg@murmeldjur.se> | 2006-09-13 07:02:07 +0000 |
| commit | 86754d7d53b59ce52de51a32f865d4916c119bdb (patch) | |
| tree | f017a8199a94e675fb50f55876119fe9e9d1944b /cli/btcli.h | |
| parent | 763cbbb59f40bdfb2478e58a685acfc262876af6 (diff) | |
| download | btpd-86754d7d53b59ce52de51a32f865d4916c119bdb.tar.gz btpd-86754d7d53b59ce52de51a32f865d4916c119bdb.zip | |
btpd now has a library of torrents indexed by number and info hash.
The add and del commands adds or removes torrents from this library. The start and stop commands are used to active or deactivate torrents. Also, a mechanism for qeurying data on torrents has been added. It's only used by the btcli list and stat commands yet though. btcli has been split into different files for each command. Both btpd and btcli now use misc/btpd_if.h for all ipc definitions. Misc changes: - struct metainfo is gone. Use the new mi_* functions. - Add printf format type checking where appropriate.
Diffstat (limited to 'cli/btcli.h')
| -rw-r--r-- | cli/btcli.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/cli/btcli.h b/cli/btcli.h new file mode 100644 index 0000000..5b64662 --- /dev/null +++ b/cli/btcli.h @@ -0,0 +1,44 @@ +#ifndef BTCLI_H +#define BTCLI_H + +#include <err.h> +#include <errno.h> +#include <getopt.h> +#include <inttypes.h> +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "btpd_if.h" +#include "metainfo.h" +#include "subr.h" +#include "benc.h" +#include "iobuf.h" +#include "queue.h" + +extern const char *btpd_dir; +extern struct ipc *ipc; + +void btpd_connect(void); +enum ipc_err handle_ipc_res(enum ipc_err err, const char *target); + +char tstate_char(enum ipc_tstate ts); +int torrent_spec(char *arg, struct ipc_torrent *tp); + +void usage_add(void); +void cmd_add(int argc, char **argv); +void usage_del(void); +void cmd_del(int argc, char **argv); +void usage_list(void); +void cmd_list(int argc, char **argv); +void usage_stat(void); +void cmd_stat(int argc, char **argv); +void usage_kill(void); +void cmd_kill(int argc, char **argv); +void usage_start(void); +void cmd_start(int argc, char **argv); +void usage_stop(void); +void cmd_stop(int argc, char **argv); + +#endif |