Cleanup the API

Remove obsolete structures / functions and prototypes of functions
that won't be implemented.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
IIOD: Signal all reading clients when the channel mask changed

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
IIOD: Only send the mask on the first read

Now that the READBUF command exits when the mask changes, we can
afford not to send the mask everytime.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Network backend: Don't try to read the mask at every loop iteration

The IIO Daemon doesn't send the mask anymore at each and every
iteration.

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

Also change its backend versions.

The iio_device_read_raw will now return a channel mask corresponding
to the buffer that has been read.

This change is rather important in the network backend, as it drops
the client-side demuxing; I decided that this should not appear in the
"read" backend function but at a higher level.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Added API functions to create/destroy/fill/use iio_buffer structures

The iio_device_create_buffer function can be used to create an
iio_buffer structure that will be mapped to the corresponding device.

The iio_buffer_destroy frees the buffer structure.

The iio_buffer_refill function will update the iio_buffer structure
with fresh data from the device.

Finally, the iio_buffer_foreach_sample will call the provided callback
with a pointer to each sample corresponding to an enabled channel.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
iio_readdev: Update to use the iio_buffer API functions

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