VLCB SDK
An opinionated SDK for VLCB protocol
Loading...
Searching...
No Matches
packet_buf.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdbool.h>
4#include <stddef.h>
5#include <stdint.h>
6
7typedef struct {
8 size_t head;
9 size_t tail;
10 size_t maxlen;
12 uint8_t buffer[];
14
15void vlcb_net_packetbuf_Init(VlcbPacketBuf *const c, size_t maxlen,
16 size_t bucket_size);
22int vlcb_net_packetbuf_Push(VlcbPacketBuf *const c, const void *data);
23int vlcb_net_packetbuf_Pop(VlcbPacketBuf *const c, void *data);
int vlcb_net_packetbuf_Pop(VlcbPacketBuf *const c, void *data)
Definition packet_buf.c:82
bool vlcb_net_packetbuf_IsEmpty(VlcbPacketBuf *const c)
Definition packet_buf.c:23
size_t vlcb_net_packetbuf_Capacity(VlcbPacketBuf *const c)
Definition packet_buf.c:40
bool vlcb_net_packetbuf_IsFull(VlcbPacketBuf *const c)
Definition packet_buf.c:29
size_t vlcb_net_packetbuf_BucketSize(VlcbPacketBuf *const c)
Definition packet_buf.c:56
void vlcb_net_packetbuf_Init(VlcbPacketBuf *const c, size_t maxlen, size_t bucket_size)
Definition packet_buf.c:7
void vlcb_net_packetbuf_Reset(VlcbPacketBuf *const c)
Definition packet_buf.c:16
int vlcb_net_packetbuf_Push(VlcbPacketBuf *const c, const void *data)
Definition packet_buf.c:62
size_t tail
Definition packet_buf.h:9
size_t maxlen
Definition packet_buf.h:10
size_t head
Definition packet_buf.h:8
size_t bucket_size
Definition packet_buf.h:11