ReadHandler


Description:

[ CCode ( cname = "yaml_read_handler_t" , instance_pos = 0.1 ) ]
public delegate int ReadHandler (uint8[] buffer, ref size_t size_read)

The prototype of a read handler.

The read handler is called when the parser needs to read more bytes from the source. The handler should write not more than size bytes to the buffer. The number of written bytes should be set to the length variable.

Parameters:

buffer

The buffer to write the data from the source.

size_read

The actual number of bytes read from the source.

data

A pointer to an application data specified by yaml_parser_set_input().

size

The size of the buffer.

Returns:

On success, the handler should return 1. If the handler failed, the returned value should be 0. On EOF, the handler should set the size_read to 0 and return 1.


Namespace: Yaml
Package: yaml-0.1