Jack2 1.9.14
ringbuffer.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2000 Paul Davis
3 Copyright (C) 2003 Rohan Drape
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19*/
20
21#ifndef _RINGBUFFER_H
22#define _RINGBUFFER_H
23
24#ifdef __cplusplus
25extern "C"
26{
27#endif
28
29#include <sys/types.h>
30
45typedef struct {
46 char *buf;
47 size_t len;
48}
50
51typedef struct {
52 char *buf;
53 volatile size_t write_ptr;
54 volatile size_t read_ptr;
55 size_t size;
56 size_t size_mask;
57 int mlocked;
58}
60
72
80
103
125
136size_t jack_ringbuffer_read(jack_ringbuffer_t *rb, char *dest, size_t cnt);
137
153size_t jack_ringbuffer_peek(jack_ringbuffer_t *rb, char *dest, size_t cnt);
154
167
176
185
194
204
214size_t jack_ringbuffer_write(jack_ringbuffer_t *rb, const char *src,
215 size_t cnt);
216
229
238
239#ifdef __cplusplus
240}
241#endif
242
243#endif
size_t jack_ringbuffer_write_space(const jack_ringbuffer_t *rb)
void jack_ringbuffer_get_write_vector(const jack_ringbuffer_t *rb, jack_ringbuffer_data_t *vec)
void jack_ringbuffer_reset(jack_ringbuffer_t *rb)
size_t jack_ringbuffer_read(jack_ringbuffer_t *rb, char *dest, size_t cnt)
jack_ringbuffer_t * jack_ringbuffer_create(size_t sz)
size_t jack_ringbuffer_read_space(const jack_ringbuffer_t *rb)
size_t jack_ringbuffer_write(jack_ringbuffer_t *rb, const char *src, size_t cnt)
void jack_ringbuffer_write_advance(jack_ringbuffer_t *rb, size_t cnt)
void jack_ringbuffer_get_read_vector(const jack_ringbuffer_t *rb, jack_ringbuffer_data_t *vec)
void jack_ringbuffer_free(jack_ringbuffer_t *rb)
void jack_ringbuffer_read_advance(jack_ringbuffer_t *rb, size_t cnt)
void jack_ringbuffer_reset_size(jack_ringbuffer_t *rb, size_t sz)
size_t jack_ringbuffer_peek(jack_ringbuffer_t *rb, char *dest, size_t cnt)
int jack_ringbuffer_mlock(jack_ringbuffer_t *rb)