Welcome to little lamb

Code » limb » master » tree

[master] / src / liblimb / obuffer.h / obuffer_attach.c

/* 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;
}