Functions to Work with Buffers (TutBuf*)


The TutBuf* functions are used to perform operations with buffers.

TutBufAllocAligned — allocate space in a buffer object

T_PTR TutBufAllocAligned(buf, size, align) 
T_BUF buf; 
T_INT4 size; 
T_INT4 align; 

TutBufAppendBuf — append the contents of one buffer into another buffer

T_PTR TutBufAppendBuf(dest, src, size) 
T_BUF dest; 
T_BUF src; 
T_INT4 size; 

TutBufAppendRange — append the contents of a range of one buffer into another buffer

T_PTR TutBufAppendRange(dest, src, begin, end) 
T_BUF dest; 
T_BUF src; 
T_INT4 begin; 
T_INT4 end; 

TutBufCloneRange — create a new buffer containing a portion of an existing buffer

T_BUF TutBufCloneRange(src, begin, end) 
T_BUF src; 
T_INT4 begin; 
T_INT4 end; 

TutBufCreate — create a new buffer

T_BUF TutBufCreate(size) 
T_INT4 size; 

TutBufCreateStatic — wrap a buffer around an existing block of data

T_BUF TutBufCreateStatic(ptr, size) 
T_PTR ptr; 
T_INT4 size; 

TutBufDeleteRange — delete a block of data from a buffer

T_BUF TutBufDeleteRange(buf, begin, end) 
T_BUF buf; 
T_INT4 begin; 
T_INT4 end; 

TutBufDestroy — destroy a buffer

T_BOOL TutBufDestroy(buf) 
T_BUF buf; 

TutBufGetSize — retrieve the number of bytes written to the buffer

T_BOOL TutBufGetSize(buf, size_return) 
T_BUF buf; 
T_INT4 *size_return; 

TutBufGrow — grow the allocated size of the buffer

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

TutBufNextAligned — allocate space in a buffer object

T_PTR TutBufNextAligned(buf, size, align) 
T_BUF buf; 
T_INT4 size; 
T_INT4 align; 

TutBufReset — resets the buffer contents

T_BOOL TutBufReset(buf, ptr) 
T_BUF buf; 
T_PTR ptr; 

TutBufRewind — rewinds the current position in the buffer

T_BOOL TutBufRewind(buf, ptr) 
T_BUF buf; 
T_PTR ptr; 

TutBufSetSize — sets the valid number of bytes in the buffer

T_BOOL TutBufSetSize(buf, size) 
T_BUF buf; 
T_INT4 size; 

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