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