Network backend: Respect the timeout when connecting

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Network backend: Add missing include

This is required when compiling libiio for uClibc.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
CMakeLists.txt: Make the git hash be a valid tag if building out-of-tree

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
iiod: Ensure that we always send 7 chars for the GIT tag

If libiio is built from a tarball instead of from the GIT tree, the GIT
tag will correspond to a tag, e.g. "v0.2". This commit ensures that we
still send 7 characters, as expected by the network backend of libiio.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Cache the Buffer's sample size for faster access

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Optimize iio_channel_read[_raw] / iio_channel_write[_raw]

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Add top-level function iio_library_get_version

This function can be used to retrieve the version of the library used at
runtime.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Bump to version 0.2

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
iio_info: Also print the version of the library

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Network backend: Use the regular connect() function in Windows

The do_connect() function uses some features of POSIX that the
compatibility layer in Windows does not provide.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
CMake: Adapt script for compiling under Visual Studio

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Makefile: Also remove old versions of libiio

Otherwise they will cause a build failure when building the test
programs.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
IIOD: Correctly exit the R/W thread when the buffer creation fails

It was previously deadlocking on the "last_cond" condition variable,
which is only signaled when CLOSE is used, which never happens if OPEN
fails.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Local backend: Issue an error if the buffer size requested is too big

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
CMake: Make programs link to libiio.so.0 instead of libiio.so.0.2

That way, we can increment the minor number of the version of the
library, and have all applications use the new library without having to
recompile them.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
CMake: Add a "doc" target to generate documentation with Doxygen

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Simplify the Makefile in the examples sub-folder

This is done so that it doesn't depend anymore on the old Makefile-based
build system.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Drop the old Makefile-based build system

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Add preliminary support for building Debian packages

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

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