BSL v0.0.0
AMMOS Bundle Protocol Security Library (BSL)
Loading...
Searching...
No Matches
UtilDefs_SeqReadWrite.h File Reference

Flat buffer data reading and writing. More...

#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <BPSecLib_Private.h>
+ Include dependency graph for UtilDefs_SeqReadWrite.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  BSL_SeqReader
 Definition of a simple flat buffer iterator. More...
 
struct  BSL_SeqWriter
 Definition of a simple flat buffer iterator. More...
 

Functions

int BSL_SeqReader_InitFlat (BSL_SeqReader_t *obj, const uint8_t *buf, size_t bufsize)
 Initialize resources for a sequential reader.
 
int BSL_SeqWriter_InitFlat (BSL_SeqWriter_t *obj, uint8_t **buf, size_t *bufsize)
 Initialize resources for a sequential writer.
 

Detailed Description

Flat buffer data reading and writing.

Definition in file UtilDefs_SeqReadWrite.h.

Function Documentation

◆ BSL_SeqReader_InitFlat()

int BSL_SeqReader_InitFlat ( BSL_SeqReader_t obj,
const uint8_t *  buf,
size_t  bufsize 
)

Initialize resources for a sequential reader.

Parameters
[in,out]objThe reader struct to allocate.
bufThe flat buffer start.
bufsizeThe flat buffer total size.
Returns
Zero if successful.

Definition at line 42 of file UtilDefs_SeqReadWrite.c.

References BSL_SUCCESS, BSL_SeqReader::cursor, and BSL_SeqReader::remain.

◆ BSL_SeqWriter_InitFlat()

int BSL_SeqWriter_InitFlat ( BSL_SeqWriter_t obj,
uint8_t **  buf,
size_t *  bufsize 
)

Initialize resources for a sequential writer.

Parameters
[in,out]objThe reader struct to allocate.
[out]bufThe flat buffer pointer to update after the writer is released.
[out]bufsizeThe flat buffer total size pointer to update after the writer is released.
Returns
Zero if successful.

Definition at line 72 of file UtilDefs_SeqReadWrite.c.

References BSL_SUCCESS, and BSL_SeqWriter::fd.