Commit Graph

55 Commits

Author SHA1 Message Date
Uwe Hermann 0abee5076f sr: Fix some TODOs, improve comments/docs. 2012-03-04 15:10:12 +01:00
Uwe Hermann cfe064d8e7 sr/cli/gtk/qt: s/hw/driver/ in some places. 2012-03-01 23:49:25 +01:00
Uwe Hermann 2f8cf27409 sr: s/sr_dev_probe_name/sr_dev_probe_name_set/. 2012-03-01 23:49:24 +01:00
Uwe Hermann c09f0b578c sr/cli/gtk/qt/: s/plugin/driver/. 2012-02-28 23:52:30 +01:00
Uwe Hermann 050e9219d6 sr: No need for dynamic hardware driver registration.
We don't need or allow run-time registration of hardware
drivers/plugins, they're added at compile-time.
2012-02-23 00:28:20 +01:00
Uwe Hermann 5097b0d091 sr/cli/gtk/qt: s/get_dev_info/dev_info_get/. 2012-02-18 11:41:21 +01:00
Uwe Hermann ffedd0bf5d sr/cli/gtk: s/capability/hwcap/. 2012-02-18 00:17:18 +01:00
Uwe Hermann bb7ef79377 sr/cli/gtk/qt: s/device/dev/ in many places.
Also, a few s/instance/inst/ occurences.
2012-02-17 23:47:00 +01:00
Uwe Hermann 44dae53925 sr: Random cosmetics, fix/amend Doxygen comments. 2012-02-17 22:40:51 +01:00
Bert Vermeulen 93a04e3be9 sr: rename all sr_hwplugin(s)_* functions to sr_hw_* 2012-02-15 03:18:48 +01:00
Bert Vermeulen da1466d677 sr: rename more functions to sr_thing_action format
Also improved the interface to find capabilities in a hardware plugin.
2012-02-14 00:23:51 +01:00
Bert Vermeulen c532476aa7 sr: rename hwplugin functions to sr_thing_action format 2012-02-13 19:56:24 +01:00
Bert Vermeulen c73d2ea421 sr: adjust copyright year 2012-02-13 14:31:51 +01:00
Bert Vermeulen 031685005b sr: rename all sr_device_* functions to sr_dev_* 2012-02-13 14:00:47 +01:00
Bert Vermeulen a1645fcd81 sr: more API cleanup and documentation 2012-02-13 03:36:32 +01:00
Bert Vermeulen 6cfa474a80 sr: rm unused sr_device_clear() and sr_device_probe_clear() 2012-02-12 22:36:19 +01:00
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
Anatoly Sokolov fd9836bfab Add sr_device_get_info 2012-01-30 13:56:38 +01:00
Uwe Hermann 66410a8617 sr: g_free()/g_string_free() can handle NULL input. 2012-01-19 00:32:02 +01:00
Uwe Hermann c37d2b1ba1 probe names: Fix cosmetics, add docs, fix off-by-one. 2011-12-29 19:50:14 +01:00
Kristoffer Sjöberg 464d12c72a Move the probe naming to the creator of the device, and let each driver name its own probes. 2011-12-29 17:04:31 +01:00
Uwe Hermann b7f09cf86d libsigrok: Fix #includes.
In the lib, we should only #include "sigrok.h" or "sigrok-internal.h",
but not the (possibly installed and thus different/older versions) via
<sigrok.h> or <sigrok-internal.h>.

Frontends should of course use <sigrok.h> and <sigrok-internal.h>.
2011-12-28 23:07:08 +01:00
Uwe Hermann a0ecd83bc6 Make more variables/functions static and non-global.
The 'GSList *devices' from device.c was actually really global (i.e.,
listed in sigrok.h), which is now fixed.
2011-12-28 22:55:21 +01:00
Uwe Hermann c5d660ae24 Drop unused 'global' struct/variable.
The libs shouldn't have any (externally visible) globals anyway.
2011-12-28 21:38:56 +01:00
Uwe Hermann 08d4cc1d14 device: Make some parameters const. 2011-12-28 21:34:37 +01:00
Uwe Hermann 0e3b143994 device: Change some functions to return int.
The callers of these functions are yet to be changed so that they
actually check the return values and handle errors appropriately.
2011-12-28 17:26:19 +01:00
Uwe Hermann 94799bc4dc device: Add Doxygen comments, improve error handling.
- Add Doxygen comments for all functions (some TODOs remain).

 - Check return code of more functions, handle invalid input.
2011-12-28 16:55:24 +01:00
Bert Vermeulen 8722c31e26 better cleanup of device/plugin resources 2011-06-05 01:51:49 +02:00
Uwe Hermann 697785d1ae libsigrok: closedev() now has a return code.
This is useful to allow frontends to react upon close failures in a
way they see fit (e.g. a popup in the GUI, or error message in the CLI).
They can also still ignore the error if they want, of course.
2011-05-05 13:06:14 +02:00
Uwe Hermann 86f5e3d826 libsigrok: Rename open/close to opendev/closedev. 2011-05-05 13:06:11 +02:00
Uwe Hermann f38bdf5678 Change left-over SIGROK_* to SR_*. 2011-04-26 23:57:16 +02:00
Uwe Hermann b53738baf7 Replace g_malloc{0,} with g_try_malloc{0,}.
The g_malloc()/g_malloc0() versions exit/segfault if not enough memory
is available, which is not a good thing in libsigrok.

Instead, we use the g_try_malloc()/g_try_malloc0() variants, which
return NULL if not enough memory is available, so that the caller can
handle the error properly.
2011-04-16 18:08:15 +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
Bert Vermeulen f437ea3fe2 small warning fix 2011-04-03 06:18:05 +02:00
Uwe Hermann 8225e92175 Constify a few more 'char *' parameters. 2011-02-20 21:16:23 +01:00
Uwe Hermann ee4b6342af Add sr_ prefix to list_hwplugins(). 2011-02-20 21:16:22 +01:00
Uwe Hermann 218557b85a Quickfix for a segfault with file input via -i.
Stuff like

  ./bin/sigrok-cli -i rnd.dd -a transitioncounter

would segfault (rnd.dd consists of random bytes) because device->plugin
was NULL and was being dereferenced.

Thanks Olivier Fauchon <olivier@aixmarseille.com> for reporting.
2011-02-13 11:27:52 +01:00
Uwe Hermann 03dbc020cd Rename probe_find() to sr_device_probe_find(). 2011-02-08 22:28:03 +01:00
Uwe Hermann 2bf4aca64a Add sr_ prefix for device related API functions. 2011-02-08 22:28:02 +01:00
Uwe Hermann 1afe89897c Add sr_ prefix for 'struct probe'. 2011-02-08 22:27:58 +01:00
Bert Vermeulen b8c2f85f56 session_driver: remove unneeded callbacks 2011-02-01 00:06:32 +01:00
Bert Vermeulen dd56a9320d fix device probe adding 2011-01-31 23:44:18 +01:00
Bert Vermeulen 7d65887435 implement session loading based on a virtual device driver 2011-01-31 22:34:14 +01:00
Uwe Hermann 5a2326a71b SR_ prefix for all public enums. 2011-01-30 18:32:59 +01:00
Uwe Hermann 5c2d46d1db Prefix device structs with sr_. 2011-01-30 18:32:58 +01:00
Uwe Hermann a00ba01228 Change all sigrok_ prefixes to sr_. 2011-01-30 18:32:55 +01:00
Bert Vermeulen e54bcdc5d1 cli: don't initialize and scan for hardware unless needed
If the -d <plugin> option is used, only initialize the specified plugin.
2011-01-24 02:49:14 +01:00
Bert Vermeulen 6ea7e23526 Revert "re-enable filter and datastore for DF_LOGIC"
This reverts commit 23da86dfc0a89c7ab951fea31a318a493830eb69.
2011-01-22 14:18:31 +01:00
Daniel Ribeiro 62eeeb171b re-enable filter and datastore for DF_LOGIC
This definitely isn't the proper fix, but it should allow DF_LOGIC
and DF_ANALOG to coexist.
2011-01-21 18:04:09 -02:00
Uwe Hermann 5e2ddeb098 Fix two more compiler warnings noticed on amd64. 2011-01-08 03:51:31 +01:00