Audacity 3.2.0
ring.h
Go to the documentation of this file.
1/*
2 Copyright 2011-2014 David Robillard <http://drobilla.net>
3
4 Permission to use, copy, modify, and/or distribute this software for any
5 purpose with or without fee is hereby granted, provided that the above
6 copyright notice and this permission notice appear in all copies.
7
8 THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16
17#ifndef ZIX_RING_H
18#define ZIX_RING_H
19
20#include <stdint.h>
21
22#include "common.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
41typedef struct ZixRingImpl ZixRing;
42
50zix_ring_new(uint32_t size);
51
55void
57
67void
69
76void
78
82uint32_t
83zix_ring_read_space(const ZixRing* ring);
84
88uint32_t
89zix_ring_write_space(const ZixRing* ring);
90
94uint32_t
95zix_ring_capacity(const ZixRing* ring);
96
100uint32_t
101zix_ring_peek(ZixRing* ring, void* dst, uint32_t size);
102
106uint32_t
107zix_ring_read(ZixRing* ring, void* dst, uint32_t size);
108
112uint32_t
113zix_ring_skip(ZixRing* ring, uint32_t size);
114
118uint32_t
119zix_ring_write(ZixRing* ring, const void* src, uint32_t size);
120
126#ifdef __cplusplus
127} /* extern "C" */
128#endif
129
130#endif /* ZIX_RING_H */
void zix_ring_reset(ZixRing *ring)
Definition: ring.cpp:100
uint32_t zix_ring_read(ZixRing *ring, void *dst, uint32_t size)
Definition: ring.cpp:172
void zix_ring_free(ZixRing *ring)
Definition: ring.cpp:86
ZixRing * zix_ring_new(uint32_t size)
Definition: ring.cpp:74
uint32_t zix_ring_read_space(const ZixRing *ring)
Definition: ring.cpp:117
uint32_t zix_ring_capacity(const ZixRing *ring)
Definition: ring.cpp:141
uint32_t zix_ring_write_space(const ZixRing *ring)
Definition: ring.cpp:135
uint32_t zix_ring_peek(ZixRing *ring, void *dst, uint32_t size)
Definition: ring.cpp:166
uint32_t zix_ring_write(ZixRing *ring, const void *src, uint32_t size)
Definition: ring.cpp:201
uint32_t zix_ring_skip(ZixRing *ring, uint32_t size)
Definition: ring.cpp:187
void zix_ring_mlock(ZixRing *ring)
Definition: ring.cpp:93