-
Notifications
You must be signed in to change notification settings - Fork 0
/
syncsource.h
35 lines (28 loc) · 933 Bytes
/
syncsource.h
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
#ifndef SYNCSOURCE_H
#define SYNCSOURCE_H
#include <event2/event.h>
#include "util/event.h"
#include "types.h"
struct syncqueue;
struct syncsource;
struct syncqueue * sq_create(struct event_base *eb);
struct event * sq_consumer(struct syncqueue *ed);
typedef void (*ss_fn)(struct syncsource *);
typedef struct chunk * (*ss_read_fn)(struct syncsource *,struct request *rq,int *);
typedef struct chunk * (*ss_write_fn)(struct syncsource *,struct request *rq,
struct chunk *ck);
struct syncsource {
struct syncqueue *sq;
struct source *src;
char *name;
ss_fn close;
ss_read_fn read;
ss_write_fn write;
void *priv;
};
struct source * syncsource_create(struct syncqueue *q,struct syncsource *ss);
struct ref * sq_ref(struct syncqueue *sq);
void sq_acquire(struct syncqueue *);
void sq_release(struct syncqueue *);
struct source * syncsource_source(struct syncsource *ss);
#endif