Example #1
0
/**
 * mate_vfs_read:
 * @handle: handle of the file to read data from.
 * @buffer: pointer to a buffer that must be at least @bytes bytes large.
 * @bytes: number of bytes to read.
 * @bytes_read: pointer to a variable that will hold the number of bytes
 * effectively read on return.
 * 
 * Read @bytes from @handle.  As with Unix system calls, the number of
 * bytes read can effectively be less than @bytes on return and will be
 * stored in @bytes_read.
 * 
 * Return value: an integer representing the result of the operation.
 */
MateVFSResult
mate_vfs_read (MateVFSHandle *handle,
		gpointer buffer,
		MateVFSFileSize bytes,
		MateVFSFileSize *bytes_read)
{
	return mate_vfs_read_cancellable (handle, buffer, bytes, bytes_read,
					   NULL);
}
static MateVFSResult
do_read (MateVFSMethod *method,
	 MateVFSMethodHandle *method_handle,
	 gpointer buffer,
	 MateVFSFileSize num_bytes,
	 MateVFSFileSize *bytes_read,
	 MateVFSContext *context)
{
	PERFORM_OPERATION_NO_URI (read, mate_vfs_read_cancellable ((MateVFSHandle *) method_handle, buffer, num_bytes, bytes_read, context));
}