// buf.c --- buffer -*- C -*- // // Copyright (c) 2026 Martin Michalec // // SPDX-License-Identifier: MIT // // This file is part of COSMOS Codebase. // // Commentary: // // Code: #include "buf.h" #include "dbg.h" struct buf buf_from (void *beg, void *ptr, void *end) { return (struct buf) { .beg = beg, .ptr = ptr, .end = end }; } struct buf buf_from_mb (struct mb mb) { return buf_from (mb.ptr, mb.ptr, MB_END (mb)); } // buf.c ends here