XDAIS  dais-x04
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Fields
XDM_BufDesc Struct Reference

Buffer descriptor for multiple buffers. More...

#include <xdm.h>

Collaboration diagram for XDM_BufDesc:
Collaboration graph

Data Fields

XDAS_Int8 ** bufs
XDAS_Int32 numBufs
XDAS_Int32bufSizes

Detailed Description

Buffer descriptor for multiple buffers.

dot_inline_dotgraph_3.png
Precondition:
numBufs can not be larger than XDM_MAX_IO_BUFFERS. Related, *bufs and *bufSizes will never be indexed beyond XDM_MAX_IO_BUFFERS elements.
Remarks:
This data type is commonly used to manage input and output buffers.
If *bufs is a sparse array, *bufSizes will be a similar sparse array. The NULL indexes in bufs will be ignored in bufSizes.
numBufs describes the number of buffers in this descriptor. if *bufs is a sparse array, numBufs describes the number of non-NULL buffers in this descriptor; this is not necessarily the maximum index of the last buffer pointed to by *bufs.
An example utilizing XDM_BufDesc as a sparse array would be the following:
XDM_BufDesc outBufs;
XDAS_Int8 buffer1[4096];
XDAS_Int8 buffer2[1024];
// ensure all pBuffers and bufSizeArray are initially NULL
memset(pBuffers, 0, sizeof(pBuffers[0]) * XDM_MAX_IO_BUFFERS);
memset(bufSizeArray, 0,
sizeof(bufSizeArray[0]) * XDM_MAX_IO_BUFFERS);
pBuffers[0] = buffer1;
pBuffers[4] = buffer2;
bufSizeArray[0] = 4096;
bufSizeArray[4] = 1024;
outBufs.bufs = pBuffers;
outBufs.numBufs = 2;
outBufs.bufSizes = bufSizeArray;
The following diagram describes graphically the example above.
dot_inline_dotgraph_4.png

Field Documentation

XDAS_Int8** XDM_BufDesc::bufs

Pointer to an array containing buffer addresses.

XDAS_Int32 XDM_BufDesc::numBufs

Number of buffers.

XDAS_Int32* XDM_BufDesc::bufSizes

Size of each buffer in 8-bit bytes.


The documentation for this struct was generated from the following file:
Copyright 2013, Texas Instruments Incorporated