QP/C
Functions
qs_blk.c File Reference

QS_getBlock() implementation. More...

#include "qs_pkg.h"

Go to the source code of this file.

Functions

uint8_t const * QS_getBlock (uint16_t *pNbytes)
 Block-oriented interface to the QS data buffer.

Detailed Description

QS_getBlock() implementation.

Definition in file qs_blk.c.


Function Documentation

uint8_t const* QS_getBlock ( uint16_t *  pNbytes)

Block-oriented interface to the QS data buffer.

This function delivers a contiguous block of data from the QS data buffer. The function returns the pointer to the beginning of the block, and writes the number of bytes in the block to the location pointed to by pNbytes. The argument pNbytes is also used as input to provide the maximum size of the data block that the caller can accept.

If no bytes are available in the QS buffer when the function is called, the function returns a NULL pointer and sets the value pointed to by pNbytes to zero.

Note:
Only the NULL return from QS_getBlock() indicates that the QS buffer is empty at the time of the call. The non-NULL return often means that the block is at the end of the buffer and you need to call QS_getBlock() again to obtain the rest of the data that "wrapped around" to the beginning of the QS data buffer.
QS_getBlock() is NOT protected with a critical section.

Definition at line 38 of file qs_blk.c.

References QS_end_, QS_PTR_AT_, QS_tail_, and QS_used_.