BufTab
Describes an array of Buffer objects (of all types, see
Buffer_Type). All buffers in a BufTab have the same size and are created with the same attributes. For this reason, one can access the first Buffer in the BufTab to learn about the characteristics of all Buffers in the BufTab. Typical usage below to allocate an array of 10 basic Buffers of size 1KB (no error checking):.
More...
Detailed Description
Describes an array of Buffer objects (of all types, see
Buffer_Type). All buffers in a BufTab have the same size and are created with the same attributes. For this reason, one can access the first Buffer in the BufTab to learn about the characteristics of all Buffers in the BufTab. Typical usage below to allocate an array of 10 basic Buffers of size 1KB (no error checking):.
Typedef Documentation
Handle through which to reference a BufTab.
Function Documentation
Creates a BufTab and the buffers belonging to it.
- Parameters:
-
[in] | numBufs | Number of buffers to allocate. |
[in] | size | Size in bytes of buffers to create. |
[in] | attrs | Buffer_Attrs to use for creating the buffers in the BufTab. |
- Return values:
-
Deletes a BufTab.
- Parameters:
-
- Return values:
-
| Dmai_EOK | for success. |
| Negative value | for failure, see Dmai.h. |
Int BufTab_chunk |
( |
BufTab_Handle |
hBufTab, |
|
|
Int |
numBufs, |
|
|
Int32 |
bufSize | |
|
) |
| | |
Chunk a BufTab in to smaller buffer sizes. This will not change the original allocation during creation, it merely tries to fit many smaller Buffers inside the already allocated Buffers.
Each buffer in a BufTab is chunked separately; i.e., if the initial buffer size is not an exact multiple of the new bufSize, the remaining space in the initial buffer becomes unused and does not count when chunking the next buffer in the BufTab.
- Parameters:
-
[in] | hBufTab | The BufTab_Handle to chunk. |
[in] | numBufs | The desired # of buffers to chunk the BufTab into |
[in] | bufSize | The size in bytes of the buffers to chunk in to. |
- Return values:
-
| The | difference between numBufs and the actual number of buffers in the newly modified BufTab. 0 if the number of buffers matches numBufs. |
| Negative value | for failure, see Dmai.h. |
Restore the BufTab to the state before BufTab_chunk was called on it. Note that this will undo any calls to BufTab_expand after the BufTab_chunk call.
- Parameters:
-
- Return values:
-
| Dmai_EOK | for success. |
| Negative value | for failure, see Dmai.h. |
Expand a BufTab with more buffers.
- Parameters:
-
[in] | hBufTab | The BufTab_Handle to expand. |
[in] | numBufs | The number of buffers to expand the BufTab with. |
- Return values:
-
| Dmai_EOK | for success. |
| Negative value | for failure, see Dmai.h. |
Return a buffer with a certain index in the BufTab.
- Parameters:
-
[in] | hBufTab | The BufTab_Handle to which the buffer belongs. |
[in] | bufIdx | The index of the buffer in the BufTab. |
- Return values:
-
| Handle | to the buffer matching the supplied index (see BufTab_Handle). |
Get the number of Buffers in a BufTab.
- Parameters:
-
[in] | hBufTab | The BufTab of which to get the number of buffers. |
- Return values:
-
| Number of buffers | in the BufTab. |
Print information about the buffers in the BufTab.
- Parameters:
-
Mark all buffers in a BufTab as free.
- Parameters:
-
Mark a Buffer as free in a BufTab.
- Parameters:
-
Return a free buffer from the BufTab and mark it as used.
- Parameters:
-
- Return values:
-