Audacity 3.2.0
|
Typedefs | |
typedef int(* | ZixComparator) (const void *a, const void *b, void *user_data) |
typedef bool(* | ZixEqualFunc) (const void *a, const void *b) |
typedef void(* | ZixDestroyFunc) (void *ptr) |
Enumerations | |
enum | ZixStatus { ZIX_STATUS_SUCCESS , ZIX_STATUS_ERROR , ZIX_STATUS_NO_MEM , ZIX_STATUS_NOT_FOUND , ZIX_STATUS_EXISTS , ZIX_STATUS_BAD_ARG , ZIX_STATUS_BAD_PERMS } |
Functions | |
static const char * | zix_strerror (const ZixStatus status) |
Ring | |
typedef struct ZixRingImpl | ZixRing |
ZixRing * | zix_ring_new (uint32_t size) |
void | zix_ring_free (ZixRing *ring) |
void | zix_ring_mlock (ZixRing *ring) |
void | zix_ring_reset (ZixRing *ring) |
uint32_t | zix_ring_read_space (const ZixRing *ring) |
uint32_t | zix_ring_write_space (const ZixRing *ring) |
uint32_t | zix_ring_capacity (const ZixRing *ring) |
uint32_t | zix_ring_peek (ZixRing *ring, void *dst, uint32_t size) |
uint32_t | zix_ring_read (ZixRing *ring, void *dst, uint32_t size) |
uint32_t | zix_ring_skip (ZixRing *ring, uint32_t size) |
uint32_t | zix_ring_write (ZixRing *ring, const void *src, uint32_t size) |
typedef int(* ZixComparator) (const void *a, const void *b, void *user_data) |
typedef void(* ZixDestroyFunc) (void *ptr) |
typedef bool(* ZixEqualFunc) (const void *a, const void *b) |
typedef struct ZixRingImpl ZixRing |
enum ZixStatus |
Enumerator | |
---|---|
ZIX_STATUS_SUCCESS | |
ZIX_STATUS_ERROR | |
ZIX_STATUS_NO_MEM | |
ZIX_STATUS_NOT_FOUND | |
ZIX_STATUS_EXISTS | |
ZIX_STATUS_BAD_ARG | |
ZIX_STATUS_BAD_PERMS |
uint32_t zix_ring_capacity | ( | const ZixRing * | ring | ) |
Return the capacity (i.e. total write space when empty).
Definition at line 141 of file ring.cpp.
References ZixRingImpl::size.
void zix_ring_free | ( | ZixRing * | ring | ) |
Destroy a ring.
Definition at line 86 of file ring.cpp.
References ZixRingImpl::buf, and staffpad::vo::free().
void zix_ring_mlock | ( | ZixRing * | ring | ) |
Lock the ring data into physical memory.
This function is NOT thread safe or real-time safe, but it should be called after zix_ring_new() to lock all ring memory to avoid page faults while using the ring (i.e. this function MUST be called first in order for the ring to be truly real-time safe).
Definition at line 93 of file ring.cpp.
References ZixRingImpl::buf, ZixRingImpl::size, and ZIX_MLOCK.
Referenced by LV2AtomPortState::LV2AtomPortState().
ZixRing * zix_ring_new | ( | uint32_t | size | ) |
Create a new ring.
size | Size in bytes (note this may be rounded up). |
At most size
- 1 bytes may be stored in the ring at once.
Definition at line 74 of file ring.cpp.
References ZixRingImpl::buf, next_power_of_two(), ZixRingImpl::read_head, ZixRingImpl::size, size, ZixRingImpl::size_mask, and ZixRingImpl::write_head.
uint32_t zix_ring_peek | ( | ZixRing * | ring, |
void * | dst, | ||
uint32_t | size | ||
) |
Read from the ring without advancing the read head.
Definition at line 166 of file ring.cpp.
References peek_internal(), ZixRingImpl::read_head, size, and ZixRingImpl::write_head.
uint32_t zix_ring_read | ( | ZixRing * | ring, |
void * | dst, | ||
uint32_t | size | ||
) |
Read from the ring and advance the read head.
Definition at line 172 of file ring.cpp.
References peek_internal(), ZixRingImpl::read_head, size, ZixRingImpl::size_mask, ZixRingImpl::write_head, and ZIX_READ_BARRIER.
Referenced by LV2AtomPortState::SendToDialog(), and LV2AtomPortState::SendToInstance().
uint32_t zix_ring_read_space | ( | const ZixRing * | ring | ) |
Return the number of bytes of space available for reading.
Definition at line 117 of file ring.cpp.
References ZixRingImpl::read_head, read_space_internal(), and ZixRingImpl::write_head.
void zix_ring_reset | ( | ZixRing * | ring | ) |
Reset (empty) a ring.
This function is NOT thread-safe, it may only be called when there are no readers or writers.
Definition at line 100 of file ring.cpp.
References ZixRingImpl::read_head, and ZixRingImpl::write_head.
uint32_t zix_ring_skip | ( | ZixRing * | ring, |
uint32_t | size | ||
) |
Skip data in the ring (advance read head without reading).
Definition at line 187 of file ring.cpp.
References ZixRingImpl::read_head, read_space_internal(), size, ZixRingImpl::size_mask, ZixRingImpl::write_head, and ZIX_READ_BARRIER.
Referenced by LV2AtomPortState::SendToDialog(), and LV2AtomPortState::SendToInstance().
uint32_t zix_ring_write | ( | ZixRing * | ring, |
const void * | src, | ||
uint32_t | size | ||
) |
Write data to the ring.
Definition at line 201 of file ring.cpp.
References ZixRingImpl::buf, ZixRingImpl::read_head, ZixRingImpl::size, size, ZixRingImpl::size_mask, ZixRingImpl::write_head, write_space_internal(), and ZIX_WRITE_BARRIER.
Referenced by LV2AtomPortState::ReceiveFromDialog(), and LV2AtomPortState::ReceiveFromInstance().
uint32_t zix_ring_write_space | ( | const ZixRing * | ring | ) |
Return the number of bytes of space available for writing.
Definition at line 135 of file ring.cpp.
References ZixRingImpl::read_head, ZixRingImpl::write_head, and write_space_internal().
|
inlinestatic |
Definition at line 66 of file common.h.
References ZIX_STATUS_BAD_ARG, ZIX_STATUS_BAD_PERMS, ZIX_STATUS_ERROR, ZIX_STATUS_EXISTS, ZIX_STATUS_NO_MEM, ZIX_STATUS_NOT_FOUND, and ZIX_STATUS_SUCCESS.