TutBufCloneRange


Name

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

Synopsis

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

Arguments

src — T_BUF object to provide data

begin — start of block to copy

end — end of block to copy

Return Values

A new T_BUF object containing the copied data if successful, NULL otherwise.

Diagnostics

None

Description

TutBufCloneRange creates a new buffer and copies a byte range from an existing buffer into the new buffer. The byte range in the source buffer starts at begin, and ends at end. If end is -1, then the complete block from begin to the end of the buffer is copied.

Caution

None

See Also

TutBufCreate, TutBufDestroy, TutBufAppendRange

Examples

This example copies eight bytes from the buffer src, starting at byte 3, to a new buffer:

T_BUF buf; 
buf = TutBufCloneRange(src, 3, 11); 
if (buf == NULL) { 
  /* error */ 
} 

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