summaryrefslogtreecommitdiff
path: root/src/irc/dcc/dcc-queue.h
blob: b05beb47f822c28f505237f967c7548f1008dbff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef __DCC_QUEUE_H_
#define __DCC_QUEUE_H_

#include "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