This obviates the need for a valid driver, and thus makes converting
from any (non-sr) input format to any output format possible; the only
thing missing is the samplerate.
Fixes bug 105.
This changes the new output API's recv() to receive(), and has it
return an integer status code. The output of the function, if any,
is stored in a new parameter as a pointer to a newly allocated GString.
All output modules using this API have been adjusted.
On Windows/MinGW 'recv' seems to be already defined in windows.h/winsock2.h.
Use 'receive' instead, for now, otherwise we get an error:
vcd.c:147:17: error: conflicting types for 'recv'
All frontends will have to include <libsigrok/libsigrok.h> from now on.
This header includes proto.h and version.h, both installed from the
distribution into $INCLUDE/libsigrok/ as well.
The only dynamically changed header is now version.h, which has both
libsigrok and libtool compile-time versions in it.
Avoid plain malloc()/free() in sr/srd, especially in the API calls.
Also avoid g_malloc*() in favor of g_try_malloc*().
Use g_strdup() instead of strdup() so that we can use g_free()
consistently everywhere.
Exceptions: Stuff that is allocated via other libs (not using glib),
should also be properly free'd using the respective free-ing function
(instead of g_free()). Examples: Stuff allocated by libusb, libftdi, etc.
Also, use sr_err() instead of sr_warn() for actual errors. sr_warn() is
meant for non-fatal/uncritical warnings.
Use SR_API to mark public API symbols, and SR_PRIV for private symbols.
Variables and functions marked 'static' are private already and don't
need SR_PRIV. However, functions which are not static (because they need
to be used in other libsigrok-internal files) but are also not meant to
be part of the public libsigrok API, must use SR_PRIV.
This uses the 'visibility' feature of gcc (requires gcc >= 4.0).
Details: http://gcc.gnu.org/wiki/Visibility