Modify prototype of API function iio_device_create_buffer

It now accepts a size_t corresponding to the number of samples that
the buffer should contain, and not its size in bytes.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Open the device when creating the iio_buffer, close it when destroying

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Change prototype of API function iio_buffer_refill

It now returns the number of bytes read from the device on success
instead of just 0.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Modify iio_device_create_buffer to handle creating output buffers

It now also takes a boolean as parameter, which should be true if
an output buffer is to be created, false otherwise.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Added API function iio_buffer_push

This function may be used to output a buffer once filled with samples.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
iio_readdev: Update to match latest API

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
IIOD: Update to use the buffer interface

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>