sys_bufget
Previous Topic  Next Topic 

Synopsis:

        sys_bufget(buf_handle,offs {,num_bytes})

Arguments:

      buf_handle       -  The buffer handle

      offs                   -  The byte offset into the buffer

      num_bytes         - Optional argument specifying the number of bytes to get.



Description:    If called with two arguments, returns the given byte in the buffer at byte offest offs as a one-character string (unless the byte is zero, in which case the string is empty). The first byte in the buffer is numbered zero.


A third argument bytes may be given specifying a number of bytes to extract from the buffer. The return value is then a string of length bytes (unless one of the bytes in the specified range is zero, in which case the zero byte terminates the string).


Return Value:


Will return 0 on success or -1 if an invalid handle is given or an attempt is made to read beyond the end or before the beginning of the buffer