summaryrefslogtreecommitdiffstats
path: root/src/irc/dcc/dcc-queue.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:18:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:18:39 +0000
commitfff5217f02d91268ce90c8c05665602c059faaef (patch)
tree2ba24d32dc96eafe7ed0a85269548e76796d849d /src/irc/dcc/dcc-queue.h
parentInitial commit. (diff)
downloadirssi-upstream.tar.xz
irssi-upstream.zip
Adding upstream version 1.4.5.upstream/1.4.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/irc/dcc/dcc-queue.h')
-rw-r--r--src/irc/dcc/dcc-queue.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/irc/dcc/dcc-queue.h b/src/irc/dcc/dcc-queue.h
new file mode 100644
index 0000000..1ab4ecb
--- /dev/null
+++ b/src/irc/dcc/dcc-queue.h
@@ -0,0 +1,45 @@
+#ifndef IRSSI_IRC_DCC_DCC_QUEUE_H_
+#define IRSSI_IRC_DCC_DCC_QUEUE_H_
+
+#include <irssi/src/irc/dcc/dcc-chat.h>
+
+enum {
+ DCC_QUEUE_NORMAL,
+ DCC_QUEUE_PREPEND,
+ DCC_QUEUE_APPEND
+};
+
+typedef struct {
+ CHAT_DCC_REC *chat;
+ char *servertag;
+ char *nick;
+ char *file;
+ int passive; /* for passive DCCs */
+} DCC_QUEUE_REC;
+
+/* create a new queue. returns it's designation number (int) */
+int dcc_queue_new(void);
+
+void dcc_queue_free(int queue);
+
+/* finds an old queue and returns it's designation number (int). if not
+ found return -1 */
+int dcc_queue_old(const char *nick, const char *servertag);
+
+/* adds nick/fname/servertag triplet into queue */
+void dcc_queue_add(int queue, int mode, const char *nick, const char *fname,
+ const char *servertag, CHAT_DCC_REC *chat, int passive);
+
+int dcc_queue_remove_head(int queue);
+
+int dcc_queue_remove_tail(int queue);
+
+/* return the first entry from queue */
+DCC_QUEUE_REC *dcc_queue_get_next(int queue);
+
+GSList *dcc_queue_get_queue(int queue);
+
+void dcc_queue_init(void);
+void dcc_queue_deinit(void);
+
+#endif