Commit Graph

31 Commits

Author SHA1 Message Date
Uwe Hermann e0508e6799 sr: session: Make most functions return int.
This allows us to return error codes etc.

Add a little more error handling.
2012-01-07 17:11:50 +01:00
Renato Caldas 446a037205 session: Fixed error reporting. 2012-01-06 15:05:28 +01:00
Uwe Hermann 3b7c8f54fc sr: Drop some obsolete and commented out code. 2012-01-02 14:25:52 +01:00
Uwe Hermann 9f45fb3aea sr: session: Add docs and some error checks. 2012-01-02 14:23:33 +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
Gareth McMullin 5c582d9f61 Remove IO source if callback returns FALSE. 2011-11-06 11:44:25 +13:00
Bert Vermeulen 7d2afd6c95 better session bus logging 2011-06-20 11:42:43 +02:00
Bert Vermeulen 8722c31e26 better cleanup of device/plugin resources 2011-06-05 01:51:49 +02:00
Uwe Hermann 86f5e3d826 libsigrok: Rename open/close to opendev/closedev. 2011-05-05 13:06:11 +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 8bb416becf Kill unused functions (avoid namespace pollution). 2011-03-03 20:24:25 +01:00
Uwe Hermann 809c5f2011 Add sr_ prefix for analog stuff some structs. 2011-02-20 21:16:24 +01:00
Uwe Hermann a887e3da97 Add sr_ prefix to receive_data_callback typedef.
Also, drop obsolete add_source() prototype from sigrok-cli.h.
2011-02-20 21:16:24 +01:00
Uwe Hermann 13b0573369 Add sr_ prefix to datafeed_callback typedef. 2011-02-20 21:16:23 +01:00
Uwe Hermann 8a2efef2d5 Add sr_ prefix to session related API functions. 2011-02-08 22:28:00 +01:00
Uwe Hermann 2872d21ebc Add sr_ prefix for 'struct session'. 2011-02-08 22:27:58 +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
Bert Vermeulen b8c2f85f56 session_driver: remove unneeded callbacks 2011-02-01 00:06:32 +01:00
Bert Vermeulen 7d65887435 implement session loading based on a virtual device driver 2011-01-31 22:34:14 +01:00
Uwe Hermann 9f4bc44e3a MinGW: Build fix. 2011-01-31 14:14:28 +01:00
Uwe Hermann 5c2d46d1db Prefix device structs with sr_. 2011-01-30 18:32:58 +01:00
Uwe Hermann b9c735a275 Prefix datafeed structs with sr_. 2011-01-30 18:32:57 +01:00
Uwe Hermann e46b8fb154 Change SIGROK_ prefix to SR_. 2011-01-30 18:32:53 +01:00
Bert Vermeulen 544a458212 move session main loop stuff into libsigrok (session_run) 2011-01-30 17:12:54 +01:00
Bert Vermeulen aa4b110766 fix session saving and input file loading
cli: -i option now properly takes the -o option into account,
so sigrok can now be used for protocol conversion with just
those two options.
2011-01-24 07:46:16 +01:00
Uwe Hermann 17e1afcb81 Whitespace and consistency fixes.
Also, drop a <poll.h> #include. It's unused anyway, and breaks the build
on MinGW/Windows as there is no poll.h there.
2011-01-13 23:52:25 +01:00
Uwe Hermann 62c8202582 libsigrok: More coding style fixes. 2010-04-15 20:16:53 +02:00
Uwe Hermann afc8e4deb6 Fix all warnings and re-enable -Wextra. 2010-04-09 22:18:46 +02:00
Uwe Hermann e31b636df6 Start unification of libsigrok return codes.
We have SIGROK_OK for functions calls where no errors occured. All
error code names start with SIGROK_ERR and are globally unique,
negative values.

The value SIGROK_ERR is a generic/unspecified error code, all others,
such as SIGROK_ERR_MALLOC, refer to a specific error condition.

This commit renames the old SIGROK_NOK etc.
2010-04-05 18:30:14 +02:00
Uwe Hermann a1bb33afbd Start of code base layout restructuring. 2010-04-02 20:27:54 +02:00