Mistake on this page?
Report an issue in GitHub or email us
Data Structures
ACore

Data Structures

struct  __ac_buffer
 
struct  __ac_buffer_builder
 

Buffer

typedef struct __ac_buffer ac_buffer_t
 
void ac_buffer_init (ac_buffer_t *pBuf, const uint8_t *data, size_t size)
 Initialize ac_buffer using underlying byte array, set ac_buffer's length to 0 (empty) More...
 
void ac_buffer_dup (ac_buffer_t *pBuf, const ac_buffer_t *pBufIn)
 Copy pBufIn to pBuf. More...
 
static const uint8_t * ac_buffer_data (const ac_buffer_t *pBuf)
 Get buffer's underlying byte array. More...
 
static size_t ac_buffer_size (const ac_buffer_t *pBuf)
 Get buffer's size. More...
 
static ac_buffer_tac_buffer_next (const ac_buffer_t *pBuf)
 Get next buffer in chain. More...
 
static void ac_buffer_set_next (ac_buffer_t *pBuf, ac_buffer_t *pNextBuf)
 Set next buffer in chain. More...
 
void ac_buffer_append (ac_buffer_t *pBuf, ac_buffer_t *pAppBuf)
 Append buffer to end of chain. More...
 
void ac_buffer_split (ac_buffer_t *pStartBuf, ac_buffer_t *pEndBuf, ac_buffer_t *pBuf, size_t length)
 Truncate pBuf to length bytes and save the remaining bytes in pEndBuf. More...
 
void ac_buffer_dump (ac_buffer_t *pBuf)
 

Buffer Builder

typedef struct __ac_buffer_builder ac_buffer_builder_t
 
void ac_buffer_builder_write_be (ac_buffer_builder_t *pBuilder, const uint8_t *buf, size_t size)
 Write data to big endian ac_buffer (on a LE architecture, byte order will be swapped) More...
 
void ac_buffer_builder_write_le (ac_buffer_builder_t *pBuilder, const uint8_t *buf, size_t size)
 Write data to little endian ac_buffer (on a LE architecture, byte order will be preserved) More...
 
void ac_buffer_builder_write_be_at (ac_buffer_builder_t *pBuilder, size_t pos, const uint8_t *buf, size_t size)
 Write data to big endian ac_buffer at specific position (on a LE architecture, byte order will be swapped) More...
 
void ac_buffer_builder_write_le_at (ac_buffer_builder_t *pBuilder, size_t pos, const uint8_t *buf, size_t size)
 Write data to little endian ac_buffer at specific position (on a LE architecture, byte order will be preserved) More...
 
void ac_buffer_builder_init (ac_buffer_builder_t *pBuilder, uint8_t *data, size_t size)
 Initialize ac_buffer builder. More...
 
void ac_buffer_builder_from_buffer (ac_buffer_builder_t *pBuilder)
 Initialize ac_buffer builder from underlying ac_buffer. More...
 
void ac_buffer_builder_reset (ac_buffer_builder_t *pBuilder)
 Reset ac_buffer builder. More...
 
void ac_buffer_builder_set_full (ac_buffer_builder_t *pBuilder)
 Set ac_buffer builder's ac_buffer to full size. More...
 
static size_t ac_buffer_builder_length (ac_buffer_builder_t *pBuilder)
 Get ac_buffer builder's length. More...
 
static void ac_buffer_builder_set_length (ac_buffer_builder_t *pBuilder, size_t length)
 Set ac_buffer builder's length. More...
 
static uint8_t * ac_buffer_builder_write_position (ac_buffer_builder_t *pBuilder)
 Get ac_buffer builder's pointer to write position. More...
 
static size_t ac_buffer_builder_write_offset (ac_buffer_builder_t *pBuilder)
 Get ac_buffer builder's write offset. More...
 
static void ac_buffer_builder_set_write_offset (ac_buffer_builder_t *pBuilder, size_t off)
 Set ac_buffer builder's write offset. More...
 
static size_t ac_buffer_builder_read_offset (ac_buffer_builder_t *pBuilder)
 Get ac_buffer builder's read offset. More...
 
static void ac_buffer_builder_set_read_offset (ac_buffer_builder_t *pBuilder, size_t off)
 Set ac_buffer builder's read offset. More...
 
static ac_buffer_tac_buffer_builder_buffer (ac_buffer_builder_t *pBuilder)
 Get ac_buffer builder's underlying ac_buffer. More...
 
static size_t ac_buffer_builder_space (ac_buffer_builder_t *pBuilder)
 Get space in ac_buffer builder. More...
 
static bool ac_buffer_builder_empty (ac_buffer_builder_t *pBuilder)
 Is ac_buffer builder empty. More...
 
static bool ac_buffer_full (ac_buffer_builder_t *pBuilder)
 Is ac_buffer builder full. More...
 
static void ac_buffer_builder_write_nu8 (ac_buffer_builder_t *pBuilder, uint8_t hu8)
 Write 8-bit value in ac_buffer builder. More...
 
static void ac_buffer_builder_write_nu16 (ac_buffer_builder_t *pBuilder, uint16_t hu16)
 Write 16-bit value in ac_buffer builder. More...
 
static void ac_buffer_builder_write_nu24 (ac_buffer_builder_t *pBuilder, uint32_t hu24)
 Write 24-bit value in ac_buffer builder. More...
 
static void ac_buffer_builder_write_nu32 (ac_buffer_builder_t *pBuilder, uint32_t hu32)
 Write 32-bit value in ac_buffer builder. More...
 
static void ac_buffer_builder_write_nu64 (ac_buffer_builder_t *pBuilder, uint64_t hu64)
 Write 64-bit value in ac_buffer builder. More...
 
static void ac_buffer_builder_write_n_bytes (ac_buffer_builder_t *pBuilder, const uint8_t *data, size_t size)
 Write n-bytes value in ac_buffer builder. More...
 
static void ac_buffer_builder_write_nu8_at (ac_buffer_builder_t *pBuilder, size_t off, uint8_t hu8)
 Write 8-bit value in ac_buffer builder at specified position. More...
 
static void ac_buffer_builder_write_nu16_at (ac_buffer_builder_t *pBuilder, size_t off, uint16_t hu16)
 Write 16-bit value in ac_buffer builder at specified position. More...
 
static void ac_buffer_builder_write_nu24_at (ac_buffer_builder_t *pBuilder, size_t off, uint32_t hu24)
 Write 24-bit value in ac_buffer builder at specified position. More...
 
static void ac_buffer_builder_write_nu32_at (ac_buffer_builder_t *pBuilder, size_t off, uint32_t hu32)
 Write 32-bit value in ac_buffer builder at specified position. More...
 
static void ac_buffer_builder_write_nu64_at (ac_buffer_builder_t *pBuilder, size_t off, uint64_t hu64)
 Write 64-bit value in ac_buffer builder at specified position. More...
 
static void ac_buffer_builder_write_n_bytes_at (ac_buffer_builder_t *pBuilder, size_t off, const uint8_t *data, size_t size)
 Write n-bytes value in ac_buffer builder at specified position. More...
 
void ac_buffer_builder_write_n_skip (ac_buffer_builder_t *pBuilder, size_t size)
 Skip n-bytes in ac_buffer builder. More...
 
void ac_buffer_builder_copy_n_bytes (ac_buffer_builder_t *pBuilderOut, ac_buffer_t *pBufIn, size_t size)
 Copy n bytes from buffer to builder. More...
 
void ac_buffer_builder_compact (ac_buffer_builder_t *pBuilder)
 Compact builder Will move underlying buffer's byte to start of allocated buffer. More...
 
static size_t ac_buffer_builder_writable (ac_buffer_builder_t *pBuilder)
 Get number of writable bytes in ac_buffer builder. More...
 

Buffer Reader

void ac_buffer_read_be (ac_buffer_t *pBuf, uint8_t *buf, size_t size)
 Read n-bytes in big-endian format from buffer reader and advance read posiion. More...
 
void ac_buffer_read_le (ac_buffer_t *pBuf, uint8_t *buf, size_t size)
 Read n-bytes in little-endian format from buffer reader and advance read posiion. More...
 
static uint8_t ac_buffer_read_nu8 (ac_buffer_t *pBuf)
 Read 8-bit value from buffer reader and advance read posiion. More...
 
static uint16_t ac_buffer_read_nu16 (ac_buffer_t *pBuf)
 Read BE 16-bit value from buffer reader and advance read posiion. More...
 
static uint32_t ac_buffer_read_nu24 (ac_buffer_t *pBuf)
 Read BE 24-bit value from buffer reader and advance read posiion. More...
 
static uint32_t ac_buffer_read_nu32 (ac_buffer_t *pBuf)
 Read BE 32-bit value from buffer reader and advance read posiion. More...
 
static uint64_t ac_buffer_read_nu64 (ac_buffer_t *pBuf)
 Read BE 64-bit value from buffer reader and advance read posiion. More...
 
static void ac_buffer_read_n_bytes (ac_buffer_t *pBuf, uint8_t *data, size_t size)
 Read n bytes from buffer reader and advance read posiion. More...
 
void ac_buffer_read_n_skip (ac_buffer_t *pBuf, size_t size)
 Skip n bytes from buffer reader and advance read posiion. More...
 
size_t ac_buffer_reader_readable (const ac_buffer_t *pBuf)
 Get number of bytes readable from buffer. More...
 
const uint8_t * ac_buffer_reader_current_buffer_pointer (ac_buffer_t *pBuf)
 Get a pointer to the current position within this buffer's current backing array. More...
 
size_t ac_buffer_reader_current_buffer_length (ac_buffer_t *pBuf)
 Get the number of bytes readable within the current backing array. More...
 
bool ac_buffer_reader_cmp_bytes (const ac_buffer_t *pBuf, const uint8_t *bytes, size_t length)
 Compare buffer with array (does not advance read position) More...
 
bool ac_buffer_reader_cmp (const ac_buffer_t *pBuf1, const ac_buffer_t *pBuf2)
 Compare buffer with array (does not advance read position) More...
 

Detailed Description

Function Documentation

void ac_buffer_append ( ac_buffer_t pBuf,
ac_buffer_t pAppBuf 
)

Append buffer to end of chain.

Parameters
pBufpointer to ac_buffer_t structure
pAppBufpointer to buffer to append to chain
static ac_buffer_t* ac_buffer_builder_buffer ( ac_buffer_builder_t pBuilder)
static

Get ac_buffer builder's underlying ac_buffer.

Parameters
pBuilderac_buffer builder
Returns
ac_buffer

Definition at line 185 of file ac_buffer_builder.h.

void ac_buffer_builder_compact ( ac_buffer_builder_t pBuilder)

Compact builder Will move underlying buffer's byte to start of allocated buffer.

Parameters
pBuilderac_buffer builder
void ac_buffer_builder_copy_n_bytes ( ac_buffer_builder_t pBuilderOut,
ac_buffer_t pBufIn,
size_t  size 
)

Copy n bytes from buffer to builder.

Parameters
pBuilderOutac_buffer builder
pBufInthe input buffer
sizenumber of bytes to copy
static bool ac_buffer_builder_empty ( ac_buffer_builder_t pBuilder)
static

Is ac_buffer builder empty.

Parameters
pBuilderac_buffer builder
Returns
true if ac_buffer builder is empty

Definition at line 203 of file ac_buffer_builder.h.

void ac_buffer_builder_from_buffer ( ac_buffer_builder_t pBuilder)

Initialize ac_buffer builder from underlying ac_buffer.

Parameters
pBuilderac_buffer builder to init
void ac_buffer_builder_init ( ac_buffer_builder_t pBuilder,
uint8_t *  data,
size_t  size 
)

Initialize ac_buffer builder.

Parameters
pBuilderac_buffer builder to init
datapointer to byte array to use
sizeof byte array
static size_t ac_buffer_builder_length ( ac_buffer_builder_t pBuilder)
static

Get ac_buffer builder's length.

Parameters
pBuilderac_buffer builder to get length of
Returns
number of valid bytes in ac_buffer

Definition at line 104 of file ac_buffer_builder.h.

static size_t ac_buffer_builder_read_offset ( ac_buffer_builder_t pBuilder)
static

Get ac_buffer builder's read offset.

Parameters
pBuilderac_buffer builder
Returns
read offset

Definition at line 159 of file ac_buffer_builder.h.

void ac_buffer_builder_reset ( ac_buffer_builder_t pBuilder)

Reset ac_buffer builder.

Parameters
pBuilderac_buffer builder to reset
void ac_buffer_builder_set_full ( ac_buffer_builder_t pBuilder)

Set ac_buffer builder's ac_buffer to full size.

Parameters
pBuilderac_buffer builder to set to full size
static void ac_buffer_builder_set_length ( ac_buffer_builder_t pBuilder,
size_t  length 
)
static

Set ac_buffer builder's length.

Parameters
pBuilderac_buffer builder to set length of
lengthnumber of valid bytes in ac_buffer

Definition at line 113 of file ac_buffer_builder.h.

static void ac_buffer_builder_set_read_offset ( ac_buffer_builder_t pBuilder,
size_t  off 
)
static

Set ac_buffer builder's read offset.

Parameters
pBuilderac_buffer builder
offnew read offset

Definition at line 168 of file ac_buffer_builder.h.

static void ac_buffer_builder_set_write_offset ( ac_buffer_builder_t pBuilder,
size_t  off 
)
static

Set ac_buffer builder's write offset.

Parameters
pBuilderac_buffer builder
offnew write offset

Definition at line 143 of file ac_buffer_builder.h.

static size_t ac_buffer_builder_space ( ac_buffer_builder_t pBuilder)
static

Get space in ac_buffer builder.

Parameters
pBuilderac_buffer builder
Returns
number of free bytes in ac_buffer builder

Definition at line 194 of file ac_buffer_builder.h.

static size_t ac_buffer_builder_writable ( ac_buffer_builder_t pBuilder)
static

Get number of writable bytes in ac_buffer builder.

Parameters
pBuilderac_buffer builder
Returns
number of free bytes in ac_buffer builder

Definition at line 356 of file ac_buffer_builder.h.

void ac_buffer_builder_write_be ( ac_buffer_builder_t pBuilder,
const uint8_t *  buf,
size_t  size 
)

Write data to big endian ac_buffer (on a LE architecture, byte order will be swapped)

Parameters
pBuilderac_buffer builder to use
bufpointer to data
sizethe data size
void ac_buffer_builder_write_be_at ( ac_buffer_builder_t pBuilder,
size_t  pos,
const uint8_t *  buf,
size_t  size 
)

Write data to big endian ac_buffer at specific position (on a LE architecture, byte order will be swapped)

Parameters
pBuilderac_buffer builder to use
posposition in ac_buffer to write from
bufpointer to data
sizethe data size
void ac_buffer_builder_write_le ( ac_buffer_builder_t pBuilder,
const uint8_t *  buf,
size_t  size 
)

Write data to little endian ac_buffer (on a LE architecture, byte order will be preserved)

Parameters
pBuilderac_buffer builder to use
bufpointer to data
sizethe data size
void ac_buffer_builder_write_le_at ( ac_buffer_builder_t pBuilder,
size_t  pos,
const uint8_t *  buf,
size_t  size 
)

Write data to little endian ac_buffer at specific position (on a LE architecture, byte order will be preserved)

Parameters
pBuilderac_buffer builder to use
posposition in ac_buffer to write from
bufpointer to data
sizethe data size
static void ac_buffer_builder_write_n_bytes ( ac_buffer_builder_t pBuilder,
const uint8_t *  data,
size_t  size 
)
static

Write n-bytes value in ac_buffer builder.

Parameters
pBuilderac_buffer builder
datadata to write
sizedata length

Definition at line 267 of file ac_buffer_builder.h.

static void ac_buffer_builder_write_n_bytes_at ( ac_buffer_builder_t pBuilder,
size_t  off,
const uint8_t *  data,
size_t  size 
)
static

Write n-bytes value in ac_buffer builder at specified position.

Parameters
pBuilderac_buffer builder
offoffset at which to write
datadata to write
sizedata length

Definition at line 328 of file ac_buffer_builder.h.

void ac_buffer_builder_write_n_skip ( ac_buffer_builder_t pBuilder,
size_t  size 
)

Skip n-bytes in ac_buffer builder.

Parameters
pBuilderac_buffer builder
sizenumber of bytes to skip
static void ac_buffer_builder_write_nu16 ( ac_buffer_builder_t pBuilder,
uint16_t  hu16 
)
static

Write 16-bit value in ac_buffer builder.

Parameters
pBuilderac_buffer builder
hu1616-bit value to write in big-endian format

Definition at line 230 of file ac_buffer_builder.h.

static void ac_buffer_builder_write_nu16_at ( ac_buffer_builder_t pBuilder,
size_t  off,
uint16_t  hu16 
)
static

Write 16-bit value in ac_buffer builder at specified position.

Parameters
pBuilderac_buffer builder
offoffset at which to write
hu1616-bit value to write

Definition at line 287 of file ac_buffer_builder.h.

static void ac_buffer_builder_write_nu24 ( ac_buffer_builder_t pBuilder,
uint32_t  hu24 
)
static

Write 24-bit value in ac_buffer builder.

Parameters
pBuilderac_buffer builder
hu2424-bit value to write in big-endian format

Definition at line 239 of file ac_buffer_builder.h.

static void ac_buffer_builder_write_nu24_at ( ac_buffer_builder_t pBuilder,
size_t  off,
uint32_t  hu24 
)
static

Write 24-bit value in ac_buffer builder at specified position.

Parameters
pBuilderac_buffer builder
offoffset at which to write
hu2424-bit value to write

Definition at line 297 of file ac_buffer_builder.h.

static void ac_buffer_builder_write_nu32 ( ac_buffer_builder_t pBuilder,
uint32_t  hu32 
)
static

Write 32-bit value in ac_buffer builder.

Parameters
pBuilderac_buffer builder
hu3232-bit value to write in big-endian format

Definition at line 248 of file ac_buffer_builder.h.

static void ac_buffer_builder_write_nu32_at ( ac_buffer_builder_t pBuilder,
size_t  off,
uint32_t  hu32 
)
static

Write 32-bit value in ac_buffer builder at specified position.

Parameters
pBuilderac_buffer builder
offoffset at which to write
hu3232-bit value to write

Definition at line 307 of file ac_buffer_builder.h.

static void ac_buffer_builder_write_nu64 ( ac_buffer_builder_t pBuilder,
uint64_t  hu64 
)
static

Write 64-bit value in ac_buffer builder.

Parameters
pBuilderac_buffer builder
hu6464-bit value to write in big-endian format

Definition at line 257 of file ac_buffer_builder.h.

static void ac_buffer_builder_write_nu64_at ( ac_buffer_builder_t pBuilder,
size_t  off,
uint64_t  hu64 
)
static

Write 64-bit value in ac_buffer builder at specified position.

Parameters
pBuilderac_buffer builder
offoffset at which to write
hu6464-bit value to write

Definition at line 317 of file ac_buffer_builder.h.

static void ac_buffer_builder_write_nu8 ( ac_buffer_builder_t pBuilder,
uint8_t  hu8 
)
static

Write 8-bit value in ac_buffer builder.

Parameters
pBuilderac_buffer builder
hu88-bit value to write

Definition at line 221 of file ac_buffer_builder.h.

static void ac_buffer_builder_write_nu8_at ( ac_buffer_builder_t pBuilder,
size_t  off,
uint8_t  hu8 
)
static

Write 8-bit value in ac_buffer builder at specified position.

Parameters
pBuilderac_buffer builder
offoffset at which to write
hu88-bit value to write

Definition at line 277 of file ac_buffer_builder.h.

static size_t ac_buffer_builder_write_offset ( ac_buffer_builder_t pBuilder)
static

Get ac_buffer builder's write offset.

Parameters
pBuilderac_buffer builder
Returns
write offset

Definition at line 134 of file ac_buffer_builder.h.

static uint8_t* ac_buffer_builder_write_position ( ac_buffer_builder_t pBuilder)
static

Get ac_buffer builder's pointer to write position.

Parameters
pBuilderac_buffer builder
Returns
pointer to write position

Definition at line 125 of file ac_buffer_builder.h.

static const uint8_t* ac_buffer_data ( const ac_buffer_t pBuf)
static

Get buffer's underlying byte array.

Parameters
pBufpointer to ac_buffer_t structure
Returns
underlying array

Definition at line 63 of file ac_buffer.h.

void ac_buffer_dup ( ac_buffer_t pBuf,
const ac_buffer_t pBufIn 
)

Copy pBufIn to pBuf.

Parameters
pBufpointer to ac_buffer_t structure to initialize
pBufInthe source buffer
static bool ac_buffer_full ( ac_buffer_builder_t pBuilder)
static

Is ac_buffer builder full.

Parameters
pBuilderac_buffer builder
Returns
true if ac_buffer builder is full

Definition at line 212 of file ac_buffer_builder.h.

void ac_buffer_init ( ac_buffer_t pBuf,
const uint8_t *  data,
size_t  size 
)

Initialize ac_buffer using underlying byte array, set ac_buffer's length to 0 (empty)

Parameters
pBufpointer to ac_buffer_t structure to initialize
databyte array to use
sizesize of byte array
static ac_buffer_t* ac_buffer_next ( const ac_buffer_t pBuf)
static

Get next buffer in chain.

Parameters
pBufpointer to ac_buffer_t structure
Returns
pointer to next buffer

Definition at line 81 of file ac_buffer.h.

void ac_buffer_read_be ( ac_buffer_t pBuf,
uint8_t *  buf,
size_t  size 
)

Read n-bytes in big-endian format from buffer reader and advance read posiion.

Parameters
pBufthe buffer to read from
bufthe array to write to
sizethe number of bytes to read
void ac_buffer_read_le ( ac_buffer_t pBuf,
uint8_t *  buf,
size_t  size 
)

Read n-bytes in little-endian format from buffer reader and advance read posiion.

Parameters
pBufthe buffer to read from
bufthe array to write to
sizethe number of bytes to read
static void ac_buffer_read_n_bytes ( ac_buffer_t pBuf,
uint8_t *  data,
size_t  size 
)
static

Read n bytes from buffer reader and advance read posiion.

Parameters
pBufthe buffer to read from
datathe array to write bytes to
sizethe number of bytes to read

Definition at line 116 of file ac_buffer_reader.h.

void ac_buffer_read_n_skip ( ac_buffer_t pBuf,
size_t  size 
)

Skip n bytes from buffer reader and advance read posiion.

Parameters
pBufthe buffer to read from
sizethe number of bytes to skip
static uint16_t ac_buffer_read_nu16 ( ac_buffer_t pBuf)
static

Read BE 16-bit value from buffer reader and advance read posiion.

Parameters
pBufthe buffer to read from
Returns
16-bit value read

Definition at line 71 of file ac_buffer_reader.h.

static uint32_t ac_buffer_read_nu24 ( ac_buffer_t pBuf)
static

Read BE 24-bit value from buffer reader and advance read posiion.

Parameters
pBufthe buffer to read from
Returns
24-bit value read

Definition at line 82 of file ac_buffer_reader.h.

static uint32_t ac_buffer_read_nu32 ( ac_buffer_t pBuf)
static

Read BE 32-bit value from buffer reader and advance read posiion.

Parameters
pBufthe buffer to read from
Returns
32-bit value read

Definition at line 93 of file ac_buffer_reader.h.

static uint64_t ac_buffer_read_nu64 ( ac_buffer_t pBuf)
static

Read BE 64-bit value from buffer reader and advance read posiion.

Parameters
pBufthe buffer to read from
Returns
64-bit value read

Definition at line 104 of file ac_buffer_reader.h.

static uint8_t ac_buffer_read_nu8 ( ac_buffer_t pBuf)
static

Read 8-bit value from buffer reader and advance read posiion.

Parameters
pBufthe buffer to read from
Returns
8-bit value read

Definition at line 60 of file ac_buffer_reader.h.

bool ac_buffer_reader_cmp ( const ac_buffer_t pBuf1,
const ac_buffer_t pBuf2 
)

Compare buffer with array (does not advance read position)

Parameters
pBuf1the buffer to compare from
pBuf2the buffer to compare with
Returns
Whether the buffers have the same length and content
bool ac_buffer_reader_cmp_bytes ( const ac_buffer_t pBuf,
const uint8_t *  bytes,
size_t  length 
)

Compare buffer with array (does not advance read position)

Parameters
pBufthe buffer to compare from
bytesthe array to compare with
lengththe array length
Returns
Whether the buffer is AT LEAST as long as the array AND the buffer and array have the same content
size_t ac_buffer_reader_current_buffer_length ( ac_buffer_t pBuf)

Get the number of bytes readable within the current backing array.

Parameters
pBufthe buffer to read from
Returns
The number of bytes readable within the current backing array
const uint8_t* ac_buffer_reader_current_buffer_pointer ( ac_buffer_t pBuf)

Get a pointer to the current position within this buffer's current backing array.

Parameters
pBufthe buffer to read from
Returns
A pointer to the current position within the current backing array
size_t ac_buffer_reader_readable ( const ac_buffer_t pBuf)

Get number of bytes readable from buffer.

Parameters
pBufthe buffer to read from
Returns
The number of bytes which can be read
static void ac_buffer_set_next ( ac_buffer_t pBuf,
ac_buffer_t pNextBuf 
)
static

Set next buffer in chain.

Parameters
pBufpointer to ac_buffer_t structure
pNextBufpointer to next buffer (or NULL to break chain)

Definition at line 90 of file ac_buffer.h.

static size_t ac_buffer_size ( const ac_buffer_t pBuf)
static

Get buffer's size.

Parameters
pBufpointer to ac_buffer_t structure
Returns
buffer's size

Definition at line 72 of file ac_buffer.h.

void ac_buffer_split ( ac_buffer_t pStartBuf,
ac_buffer_t pEndBuf,
ac_buffer_t pBuf,
size_t  length 
)

Truncate pBuf to length bytes and save the remaining bytes in pEndBuf.

Parameters
pBufThe buffer to split (will be set to invalid state)
pStartBufA new buffer at the head of the split
pEndBufA new buffer at the tail of the split
lengthHow long pStartBuf should be (if longer than pBuf, then pStartBuf will be pBuf)
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.