34#define IO_HANDLE_ERROR ((io_handle_t)NULL)
void lely_io_fini(void)
Finalizes the I/O library and terminates the availability of the I/O functions.
int io_close(io_handle_t handle)
Closes an I/O device.
int64_t io_off_t
A file offset type.
int io_get_type(io_handle_t handle)
Returns the type of an I/O device (one of IO_TYPE_CAN, IO_TYPE_FILE, IO_TYPE_PIPE,...
@ IO_TYPE_FILE
A regular file.
@ IO_TYPE_SERIAL
A serial I/O device.
@ IO_TYPE_CAN
A CAN device.
@ IO_TYPE_SOCK
A network socket.
ssize_t io_read(io_handle_t handle, void *buf, size_t nbytes)
Performs a read operation.
io_handle_t io_handle_acquire(io_handle_t handle)
Increments the reference count of an I/O device handle.
struct io_handle * io_handle_t
An opaque I/O device handle type.
int io_handle_unique(io_handle_t handle)
Returns 1 if there is only a single reference to the specified I/O device handle, and 0 otherwise.
int lely_io_init(void)
Initializes the I/O library and makes the I/O functions available for use.
int io_get_fd(io_handle_t handle)
Returns the native file descriptor of an I/O device.
int io_flush(io_handle_t handle)
Flushes the write buffer of a an I/O device.
int io_set_flags(io_handle_t handle, int flags)
Sets the flags of an I/O device.
@ IO_FLAG_NONBLOCK
Perform I/O operations in non-blocking mode.
@ IO_FLAG_LOOPBACK
Receive own messages (i.e., sent by the same device).
@ IO_FLAG_NO_CLOSE
Do not close the native file descriptor when closing an I/O device.
int io_get_flags(io_handle_t handle)
Obtains the flags of an I/O device.
ssize_t io_write(io_handle_t handle, const void *buf, size_t nbytes)
Performs a write operation.
void io_handle_release(io_handle_t handle)
Decrements the reference count of an I/O device handle.
This is the public header file of the utilities library.
This header file is part of the C11 and POSIX compatibility library; it includes <stddef....
This header file is part of the C11 and POSIX compatibility library; it includes <stdint....
An opaque network address type.
This header file is part of the C11 and POSIX compatibility library; it includes <sys/types....
ptrdiff_t ssize_t
Used for a count of bytes or an error indication.
An opaque serial I/O device attributes type.