34 #define IO_HANDLE_ERROR ((io_handle_t)NULL) 171 ssize_t
io_read(io_handle_t handle,
void *buf,
size_t nbytes);
184 ssize_t
io_write(io_handle_t handle,
const void *buf,
size_t nbytes);
199 #endif // !LELY_IO_IO_H_ This header file is part of the C11 and POSIX compatibility library; it includes <sys/types.h>, if it exists, and defines any missing functionality.
int io_flush(io_handle_t handle)
Flushes the write buffer of a an I/O device.
Receive own messages (i.e., sent by the same device).
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_SERIAL or IO_TYPE_SOCK), or -1 on error.
An opaque network address type.
ssize_t io_write(io_handle_t handle, const void *buf, size_t nbytes)
Performs a write operation.
int io_get_flags(io_handle_t handle)
Obtains the flags of an I/O device.
int lely_io_init(void)
Initializes the I/O library and makes the I/O functions available for use.
struct io_handle * io_handle_t
An opaque I/O device handle type.
io_handle_t io_handle_acquire(io_handle_t handle)
Increments the reference count of an I/O device handle.
void lely_io_fini(void)
Finalizes the I/O library and terminates the availability of the I/O functions.
Perform I/O operations in non-blocking mode.
Do not close the native file descriptor when closing an I/O device.
An opaque serial I/O device attributes type.
int io_set_flags(io_handle_t handle, int flags)
Sets the flags of an I/O device.
This header file is part of the C11 and POSIX compatibility library; it includes <stddef.h> and defines any missing functionality.
void io_handle_release(io_handle_t handle)
Decrements the reference count of an I/O device handle.
ssize_t io_read(io_handle_t handle, void *buf, size_t nbytes)
Performs a read operation.
int io_close(io_handle_t handle)
Closes an I/O device.
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...
This header file is part of the C11 and POSIX compatibility library; it includes <stdint.h> and defines any missing functionality.
int io_get_fd(io_handle_t handle)
Returns the native file descriptor of an I/O device.
int64_t io_off_t
A file offset type.
This is the public header file of the utilities library.