SIO_staticbuf
2-410
C Interface
Syntax
nmadus = SIO_staticbuf(stream, bufp);
Parameters
SIO_Handle stream;
/* stream handle */
Ptr
*bufp;
/* pointer to a buffer */
Return Value
Int
nmadus; /* number of MADUs in buffer */
Description
SIO_staticbuf returns buffers for static streams that were configured
statically. Buffers are allocated for static streams by checking the
Allocate Static Buffer(s) check box for the related SIO object.
SIO_staticbuf returns the size of the buffer or 0 if no more buffers are
available from the stream.
An inconsistency exists between the sizes of buffers in a stream and the
return types corresponding to these sizes. While all buffer sizes in a
stream are of type size_t, APIs that return a buffer size return a type of
Int. This due to a change in stream buffer sizes and the need to retain the
return type for backward compatibility. Because of this inconsistency, it is
not possible to return the correct buffer size when the actual buffer size
exceeds the size of an Int type. This issue has the following implications:
❏
If the actual buffer size is less than/equal to the maximum
positive Int value (15 bits).
Check the return value for negative
values, which indicate errors. Positive values reflect the correct size.
❏
If the actual buffer size is greater than the maximum positive Int
value.
Ignore the return value. There is little room for this situation on
’C55x large model since size_t is the same as unsigned int. Since the
sign in Int takes up one bit, the size_t type contains just one more bit
than an Int. If you are using the ’C55x huge model, size_t is 32 bits
and Int allows positive integers only up to 15 bits.
SIO_staticbuf can be called multiple times for SIO_ISSUERECLAIM
model streams.
SIO_staticbuf must be called to acquire all static buffers before calling
SIO_get, SIO_put, SIO_issue or SIO_reclaim.
SIO_staticbuf
Acquire static buffer from stream