summaryrefslogtreecommitdiffstats
path: root/src/memblockq.h
blob: 9543b40a62b375fed02b6ca9b3c669c49aa606ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef foomemblockqhfoo
#define foomemblockqhfoo

#include <sys/types.h>

#include "memblock.h"

struct memblockq;

struct memblockq* memblockq_new(size_t maxlength, size_t base, size_t prebuf);
void memblockq_free(struct memblockq* bq);

void memblockq_push(struct memblockq* bq, struct memchunk *chunk, size_t delta);

int memblockq_pop(struct memblockq* bq, struct memchunk *chunk);
int memblockq_peek(struct memblockq* bq, struct memchunk *chunk);
void memblockq_drop(struct memblockq *bq, size_t length);

void memblockq_shorten(struct memblockq *bq, size_t length);
void memblockq_empty(struct memblockq *bq);

int memblockq_is_readable(struct memblockq *bq);
int memblockq_is_writable(struct memblockq *bq, size_t length);

uint32_t memblockq_get_latency(struct memblockq *bq);

#endif