#include <unistd.h>
#include <errno.h>
#include <stdio.h>
#include "ustream.h"
Go to the source code of this file.
◆ __ustream_fd_poll()
static bool __ustream_fd_poll |
( |
struct ustream_fd * |
sf, |
|
|
unsigned int |
events |
|
) |
| |
|
static |
Definition at line 116 of file ustream-fd.c.
static struct epoll_event events[ULOOP_MAX_EVENTS]
static void ustream_fd_set_uloop(struct ustream *s, bool write)
static void ustream_fd_read_pending(struct ustream_fd *sf, bool *more)
bool ustream_write_pending(struct ustream *s)
static void ustream_state_change(struct ustream *s)
◆ ustream_fd_free()
static void ustream_fd_free |
( |
struct ustream * |
s | ) |
|
|
static |
Definition at line 153 of file ustream-fd.c.
#define container_of(ptr, type, member)
int uloop_fd_delete(struct uloop_fd *fd)
◆ ustream_fd_init()
void ustream_fd_init |
( |
struct ustream_fd * |
sf, |
|
|
int |
fd |
|
) |
| |
Definition at line 160 of file ustream-fd.c.
int(* write)(struct ustream *s, const char *buf, int len, bool more)
void(* set_read_blocked)(struct ustream *s)
void(* free)(struct ustream *s)
bool(* poll)(struct ustream *s)
static int ustream_fd_write(struct ustream *s, const char *buf, int buflen, bool more)
static bool ustream_fd_poll(struct ustream *s)
static void ustream_fd_free(struct ustream *s)
static void ustream_fd_set_read_blocked(struct ustream *s)
static void ustream_uloop_cb(struct uloop_fd *fd, unsigned int events)
void ustream_init_defaults(struct ustream *s)
◆ ustream_fd_poll()
static bool ustream_fd_poll |
( |
struct ustream * |
s | ) |
|
|
static |
Definition at line 139 of file ustream-fd.c.
static bool __ustream_fd_poll(struct ustream_fd *sf, unsigned int events)
◆ ustream_fd_read_pending()
static void ustream_fd_read_pending |
( |
struct ustream_fd * |
sf, |
|
|
bool * |
more |
|
) |
| |
|
static |
Definition at line 45 of file ustream-fd.c.
60 len = read(sf->
fd.
fd, buf, buflen);
65 if (errno == EAGAIN || errno == ENOTCONN)
enum read_blocked_reason read_blocked
void ustream_fill_read(struct ustream *s, int len)
char * ustream_reserve(struct ustream *s, int len, int *maxlen)
◆ ustream_fd_set_read_blocked()
static void ustream_fd_set_read_blocked |
( |
struct ustream * |
s | ) |
|
|
static |
◆ ustream_fd_set_uloop()
static void ustream_fd_set_uloop |
( |
struct ustream * |
s, |
|
|
bool |
write |
|
) |
| |
|
static |
Definition at line 24 of file ustream-fd.c.
struct ustream_buf * head
struct ustream_buf_list r w
int uloop_fd_add(struct uloop_fd *sock, unsigned int flags)
#define ULOOP_EDGE_TRIGGER
◆ ustream_fd_write()
static int ustream_fd_write |
( |
struct ustream * |
s, |
|
|
const char * |
buf, |
|
|
int |
buflen, |
|
|
bool |
more |
|
) |
| |
|
static |
Definition at line 84 of file ustream-fd.c.
93 len = write(sf->
fd.
fd, buf, buflen);
99 if (errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOTCONN)
◆ ustream_uloop_cb()
static void ustream_uloop_cb |
( |
struct uloop_fd * |
fd, |
|
|
unsigned int |
events |
|
) |
| |
|
static |