/* This file is part of limb https://lila.oss/limb
* Copyright (C) 2023 Olivier Brunel jjk@jjacky.com */
/* SPDX-License-Identifier: GPL-2.0-only */
#include <errno.h>
#include <limb/obuffer.h>
int
obuffer_attach(obuffer *b, obuffer *to)
{
if (b->n) return (errno = EINVAL, 0);
b->n = to;
to->n = b;
return 1;
}