summaryrefslogtreecommitdiffstats
path: root/qbuf.h
blob: 12d07b78b6a020b74384e4615f5be798289bfad8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef fooqbufhfoo
#define fooqbufhfoo

/* $Id$ */

#include <sys/types.h>

struct qbuf {
    void *data;
    size_t length, index, fill;
};

void qbuf_init(struct qbuf *q, size_t length);
void qbuf_done(struct qbuf *q);

void* qbuf_push(struct qbuf *q, size_t *l);
void qbuf_push_validate(struct qbuf *q, size_t l);

void* qbuf_pull(struct qbuf *q, size_t *l);
void qbuf_pull_invalidate(struct qbuf *q, size_t l);

#endif