TutBufGrow


Name

TutBufGrow — grow the allocated size of the buffer

Synopsis

T_BOOL TutBufGrow(buf, new_size) 
T_BUF buf; 
T_INT4 new_size; 

Arguments

buf — buffer to grow

new_size — new size of the buffer

Return Values

TRUE if successful, FALSE otherwise.

Diagnostics

None

Description

TutBufGrow attempts to resize a buffer to allow it to hold at least new_size bytes. The buffer may grow larger than the requested size. The buffer may be moved, and the existing data is copied, if necessary. This function is called automatically by any operation that needs to increase the size of the buffer. If this function is called on a static buffer, it fails.

Caution

None

See Also

TutBufCreate

Examples

This example grows a buffer to 256 bytes:

T_BOOL status; 
 
status = TutBufGrow(buf, 256); 
if (status == FALSE) { 
  /* error */ 
} 

TIBCO SmartSockets™ Utilities
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com