// iobuf.h --- Input/Output buffer -*- C -*- // // Copyright (c) 2026 Martin Michalec // // SPDX-License-Identifier: MIT // // This file is part of COSMOS Codebase. // // Commentary: // // Code: #ifndef INCLUDED_COSMOS_IOBUF_H #define INCLUDED_COSMOS_IOBUF_H #include "ms.h" struct iobuf { u8 *beg; u8 *rhead; u8 *whead; u8 *end; }; struct iobuf iobuf_from (struct ms ms); usz iobuf_sz (struct iobuf); struct mv *iobuf_rmv (struct iobuf *); struct ms *iobuf_wms (struct iobuf *); void iobuf_compact (struct iobuf *); #ifndef IOBUF_NO_UNISTD int iobuf_read (struct iobuf *, int fd); #endif // IOBUF_NO_UNISTD #endif // INCLUDED_COSMOS_IOBUF_H // iobuf.h ends here