TutBufNextAligned reserve space in a T_BUF object
buf
T_BUF object in which to reserve the space
size
number of bytes to reserve
align
alignment factor
Pointer to the memory block at the current position if successful; NULL
otherwise.
None
TutBufNextAligned returns the current position in the T_BUF object to you, and then moves the current position to reserve the requested space. The new position is size
bytes past the current position you started with, rounded up to align it with the given alignment factor.
The returned pointer is only valid until the next call to a buffer operation that may resize the buffer, because the buffer may be moved during a resize.
This example moves the read index 10 bytes forward, ending on an 8-byte boundary:
TIBCO SmartSockets™ Utilities Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |