XDM_BufDesc Struct Reference
[Shared XDM Definitions]

#include <xdm.h>


Detailed Description

Buffer descriptor for multiple buffers.

inline_dotgraph_1

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_Int32  bufSizeArray[XDM_MAX_IO_BUFFERS];
              XDAS_Int8  *pBuffers[XDM_MAX_IO_BUFFERS];
              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.

inline_dotgraph_2


Data Fields

XDAS_Int8 ** bufs
XDAS_Int32 numBufs
XDAS_Int32bufSizes


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 2009, Texas Instruments Incorporated