summaryrefslogtreecommitdiff
path: root/uring.h
blob: 35cdec49eabe137306e5069247191b171a42b620 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef foouringhfoo
#define foouringhfoo

extern uint64_t sqe_count;
extern uint64_t cqe_count;

void uring_task_refdump(struct uring_task *task);

void uring_task_destroy(struct cfg *cfg, struct uring_task *task);

void uring_task_put(struct cfg *cfg, struct uring_task *task);

void uring_task_get(struct cfg *cfg, struct uring_task *task);

void uring_task_set_buf(struct uring_task *task, struct uring_task_buf *tbuf);

void uring_task_set_fd(struct uring_task *task, int fd);

void uring_task_close_fd(struct cfg *cfg, struct uring_task *task);

struct uring_task *uring_parent(struct cfg *cfg);

void uring_task_init(struct uring_task *task, const char *name,
		     struct uring_task *parent,
		     void (*free)(struct uring_task *));

void uring_close(struct cfg *cfg, struct uring_task *task, int fd);

void uring_tbuf_write(struct cfg *cfg, struct uring_task *task,
		      utask_cb_t final_cb);

void uring_write(struct cfg *cfg, struct uring_task *task, void *buf,
		 size_t len, utask_cb_t cb);

void uring_tbuf_read_until(struct cfg *cfg, struct uring_task *task,
			   rutask_cb_t is_complete_cb, utask_cb_t final_cb);

void uring_tbuf_read_until_eof(struct cfg *cfg, struct uring_task *task,
			       utask_cb_t final_cb);

void uring_tbuf_read(struct cfg *cfg, struct uring_task *task,
		     utask_cb_t final_cb);

void uring_read_offset(struct cfg *cfg, struct uring_task *task, void *buf,
		       size_t len, off_t offset, utask_cb_t cb);

static inline void
uring_read(struct cfg *cfg, struct uring_task *task, void *buf, size_t len,
	   utask_cb_t cb)
{
	uring_read_offset(cfg, task, buf, len, 0, cb);
}

void uring_openat(struct cfg *cfg, struct uring_task *task, const char *path,
		  utask_cb_t cb);

void uring_tbuf_recvmsg(struct cfg *cfg, struct uring_task *task, utask_cb_t cb);

void uring_tbuf_sendmsg(struct cfg *cfg, struct uring_task *task, utask_cb_t cb);

void uring_connect(struct cfg *cfg, struct uring_task *task,
		   struct saddr *saddr, utask_cb_t cb);

void uring_accept(struct cfg *cfg, struct uring_task *task,
		  struct saddr *saddr, utask_cb_t cb);

void uring_poll(struct cfg *cfg, struct uring_task *task, short poll_mask,
		utask_cb_t cb);

void uring_poll_cancel(struct cfg *cfg, struct uring_task *task);

void uring_delete(struct cfg *cfg);

void uring_refdump(struct uring_ev *uev);

void uring_init(struct cfg *cfg);

void uring_event_loop(struct cfg *cfg);

#endif