about summary refs log tree commit diff
path: root/cli/btpd_if.h
diff options
context:
space:
mode:
authorRichard Nyberg <rnyberg@murmeldjur.se>2006-02-08 22:56:35 +0000
committerRichard Nyberg <rnyberg@murmeldjur.se>2006-02-08 22:56:35 +0000
commit2550d6cb8c7f263f63a68122b69285f8f849dc18 (patch)
treee809413c7b7c3c9188bbd887b7b7fca9875e4d2b /cli/btpd_if.h
parent1a82f0c154b3f7d4bf0fe4410135d4c735a98672 (diff)
downloadbtpd-2550d6cb8c7f263f63a68122b69285f8f849dc18.tar.gz
btpd-2550d6cb8c7f263f63a68122b69285f8f849dc18.zip
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 :)

Diffstat (limited to 'cli/btpd_if.h')
-rw-r--r--cli/btpd_if.h22
1 files changed, 11 insertions, 11 deletions
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 <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-
 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