ring.h revision 2eec67acbb00593e414549a7e5b35eb7dd776b1b
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#pragma once
/***
This file is part of systemd.
Copyright 2014 David Herrmann <dh.herrmann@gmail.com>
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
struct Ring {
};
/* flush buffer so it is empty again */
void ring_flush(Ring *r);
/* flush buffer, free allocated data and reset to initial state */
void ring_clear(Ring *r);
/* get pointers to buffer data and their length */
/* copy data into external linear buffer */
/* push data to the end of the buffer */
/* pull data from the front of the buffer */
/* return size of occupied buffer in bytes */
{
return r->used;
}