Add pushtigertree.
[doldaconnect.git] / clients / gnome-trans-applet / conduit.h
CommitLineData
d3372da9 1#ifndef _CONDUIT_H
2#define _CONDUIT_H
3
4#include <sys/types.h>
5
6#define CNDS_IDLE 0
7#define CNDS_SYN 1
8#define CNDS_EST 2
9
10struct transfer
11{
12 struct transfer *next, *prev;
13 struct conduit *conduit;
14 char *tag; /* UTF8 */
15 int pos, size;
16 time_t cmptime, ckptime;
17 size_t cmpsize, ckpsize;
18 int timeout;
19};
20
21struct conduit
22{
23 struct transfer *transfers;
24 struct conduitiface *iface;
25 void *cdata, *udata;
26 int state;
27};
28
29struct conduitiface
30{
31 int (*init)(struct conduit *conduit);
32 int (*connect)(struct conduit *conduit);
33 void (*destroy)(struct conduit *conduit);
34};
35
36struct transfer *findtransferbytag(struct conduit *conduit, char *tag);
37void transfersetsize(struct transfer *transfer, int size);
38void transfersetpos(struct transfer *transfer, int pos);
39struct transfer *newtransfer(struct conduit *conduit, char *tag, int size, int pos);
40void freetransfer(struct transfer *transfer);
41struct conduit *newconduit(struct conduitiface *iface, void *udata);
42void freeconduit(struct conduit *conduit);
43int condtryconn(struct conduit *conduit);
44void conddisconn(struct conduit *conduit);
45void condconnected(struct conduit *conduit);
46
47extern void (*cb_condstate)(struct conduit *conduit, void *data);
48extern void (*cb_trsize)(struct transfer *transfer, void *data);
49extern void (*cb_trpos)(struct transfer *transfer, void *data);
50extern void (*cb_trnew)(struct transfer *transfer, void *data);
51extern void (*cb_trfree)(struct transfer *transfer, void *data);
52extern struct conduitiface *conduit_pipe;
53extern struct conduitiface *conduit_dclib;
54
55#endif