Commit Graph

15 Commits

Author SHA1 Message Date
Uwe Hermann 1a081ca67d sr: Mark API functions with SR_API/SR_PRIV.
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
2012-02-02 00:03:17 +01:00
Uwe Hermann 69890f7399 sr: Eliminate usb/serial instances from API.
The API should be generic and only provide sr_device_instance_new() and
friends, but not sr_usb_device_instance_new(), sr_serial_device_instance_new(),
or others for other device types we may have in the future. The
frontends shouldn't have to know or care about this implementation detail.

This also fixes the problem that parts of sigrok.h contained
'#ifdef HAVE_LIBUSB_1_0' and such, which is even less desirable for the API.

The usb/serial instance specifics are now private, and each driver that
needs them keeps a pointer in its driver-specific context.
2012-01-31 02:04:35 +01:00
Uwe Hermann 8ff6afc95d sr: Consistently use 512kB as default chunk size. 2012-01-06 16:20:28 +01:00
Uwe Hermann 2d83e0f963 Fix outdated ezusb_install_firmware() prototype. 2011-12-28 23:11:52 +01:00
Uwe Hermann cc8a7d250c Add missing #includes to avoid clang warnings. 2011-11-24 22:42:02 +01:00
Uwe Hermann 06dd80d424 Add sr_spew/SR_LOG_SPEW for even more debug output.
This is meant for really extensive debug output which can slow down
operation significantly and should thus only be enabled if really needed.
2011-05-09 01:03:21 +02:00
Uwe Hermann 1352eeddd4 libsigrok/cli: Implement loglevel support.
libsigrok can now be told at which loglevel to work, i.e., how many
debug/error/warning output to generate. You can also query the current
loglevel.

In sigrok-cli it is now possible to set the loglevel via -l. For example:

 - Disable all output: sigrok-cli -l 0
 - Only show errors: sigrok-cli -l 1
 - Show errors, warnings, info, and debug messages: sigrok-cli -l 4
2011-05-05 13:06:13 +02:00
Uwe Hermann b08024a836 libsigrok: Introduce sr_dbg/sr_info/sr_warn/sr_err.
We should use these (internal) functions in libsigrok exclusively from
now on, i.e. no more use of glib's g_debug() etc.

These functions are only for libsigrok, the frontends use whatever
logging mechanism is suitable there.
2011-04-14 10:11:08 +02:00
Uwe Hermann f5a443f27a Make DATASTORE_CHUNKSIZE private. 2011-03-03 20:24:24 +01:00
Uwe Hermann 4cea9eb20d Make ARRAY_SIZE/ARRAY_AND_SIZE private.
This is not libsigrok-specific and should not be part of our API.
2011-02-20 21:16:26 +01:00
Uwe Hermann 8233ff53ae Make load_hwplugins() private. 2011-02-20 21:16:22 +01:00
Uwe Hermann 22b0238344 Fix build when no libusb-LA is compiled.
Until now the build would break if the user doesn't enable at least one
of the libusb1.0-based LAs. I.e., you could not compile only OLS, or
only the demo driver.
2011-02-02 10:25:52 +01:00
Uwe Hermann a00ba01228 Change all sigrok_ prefixes to sr_. 2011-01-30 18:32:55 +01:00
Uwe Hermann 058b70353d Move more non-public headers to sigrok-internal.h. 2011-01-19 01:16:19 +01:00
Uwe Hermann 1483577eed Start moving private stuff to sigrok-internal.h.
This is work-in-progress, unfinished.
2011-01-15 15:57:54 +01:00