about summary refs log tree commit diff
path: root/misc/ipcdefs.h
diff options
context:
space:
mode:
authorRichard Nyberg <rnyberg@murmeldjur.se>2006-09-12 21:17:26 +0000
committerRichard Nyberg <rnyberg@murmeldjur.se>2006-09-12 21:17:26 +0000
commit848de36107edd65fc9135afe22f8f486af390393 (patch)
tree0a666625660333bc264688392683f8075a8764dc /misc/ipcdefs.h
parenta162d34982bf2d44116dae10437fe9b4c1cda0a0 (diff)
downloadbtpd-848de36107edd65fc9135afe22f8f486af390393.tar.gz
btpd-848de36107edd65fc9135afe22f8f486af390393.zip
This file contains the definitions of the constants used in the btpd
interface.

Diffstat (limited to 'misc/ipcdefs.h')
-rw-r--r--misc/ipcdefs.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/misc/ipcdefs.h b/misc/ipcdefs.h
new file mode 100644
index 0000000..98b2e1b
--- /dev/null
+++ b/misc/ipcdefs.h
@@ -0,0 +1,45 @@
+#ifndef ERRDEF
+#define __IPCE
+#define ERRDEF(name, msg)
+#endif
+ERRDEF(OK,              "no error")
+ERRDEF(COMMERR,         "communication error")
+ERRDEF(EBADCDIR,        "bad content directory")
+ERRDEF(EBADT,           "bad torrent")
+ERRDEF(EBADTENT,        "bad torrent entry")
+ERRDEF(EBADTRACKER,     "bad tracker")
+ERRDEF(ECREATECDIR,     "couldn't create content directory")
+ERRDEF(ENOKEY,          "no such key")
+ERRDEF(ENOTENT,         "no such torrent")
+ERRDEF(ESHUTDOWN,       "btpd is shutting down")
+ERRDEF(ETACTIVE,        "torrent is active")
+ERRDEF(ETENTEXIST,      "torrent entry exists")
+ERRDEF(ETINACTIVE,      "torrent is inactive")
+#ifdef __IPCE
+#undef __IPCE
+#undef ERRDEF
+#endif
+#ifndef TVDEF
+#define __IPCTV
+#define TVDEF(val, type, name)
+#endif
+TVDEF(CGOT,     NUM,            "content_got")
+TVDEF(CSIZE,    NUM,            "content_size")
+TVDEF(DIR,      PATH,           "dir")
+TVDEF(NAME,     STR,            "name")
+TVDEF(NUM,      NUM,            "num")
+TVDEF(IHASH,    BIN,            "info_hash")
+TVDEF(PCGOT,    NUM,            "pieces_got")
+TVDEF(PCOUNT,   NUM,            "peer_count")
+TVDEF(PCCOUNT,  NUM,            "piece_count")
+TVDEF(PCSEEN,   NUM,            "pieces_seen")
+TVDEF(RATEDWN,  NUM,            "rate_down")
+TVDEF(RATEUP,   NUM,            "rate_up")
+TVDEF(SESSDWN,  NUM,            "sess_down")
+TVDEF(SESSUP,   NUM,            "sess_up")
+TVDEF(STATE,    TSTATE,         "state")
+TVDEF(TRERR,    NUM,            "tr_errors")
+#ifdef __IPCTV
+#undef __IPCTV
+#undef TVDEF
+#endif