#ifndef UCS_ASYNC_PIPE_H
#define UCS_ASYNC_PIPE_H
#include <ucs/type/status.h>
BEGIN_C_DECLS
#define UCS_ASYNC_PIPE_INVALID_FD (-1)
typedef struct ucs_async_pipe {
int read_fd;
int write_fd;
} ucs_async_pipe_t ;
#define UCS_ASYNC_PIPE_INITIALIZER \
{ \
UCS_ASYNC_PIPE_INVALID_FD, UCS_ASYNC_PIPE_INVALID_FD \
}
ucs_status_t ucs_async_pipe_create(ucs_async_pipe_t *p);
void ucs_async_pipe_destroy(ucs_async_pipe_t *p);
void ucs_async_pipe_invalidate(ucs_async_pipe_t *p);
void ucs_async_pipe_push(ucs_async_pipe_t *p);
void ucs_async_pipe_drain(ucs_async_pipe_t *p);
static inline int ucs_async_pipe_rfd(ucs_async_pipe_t *p) {
return p->read_fd;
}
END_C_DECLS
#endif