summaryrefslogtreecommitdiff
path: root/libsigrokdecode-internal.h
AgeCommit message (Collapse)Author
2017-02-21Clarify that {start,end,cur}_samplenum are absolute numbers.Uwe Hermann
2017-02-20Support adding multiple instances of a decoderKarl Palsson
srd_inst_new() used the decoder ID as the instance ID, preventing the use of multiple instances of the same decoder in the same session. Simply append a numerical suffix to later instances to allow more. Required changes to cleanup to reliably free all memory. Valgrind checked. This fixes parts of bug #868. Based on original work by: Soeren Apel <soeren@apelpie.net> Signed-off-by: Karl Palsson <karlp@etactica.com>
2017-01-07license: remove FSF postal address from boiler plate license textGerhard Sittig
Remove the FSF postal address as it might change (it did in the past). Reference the gnu.org website instead which is more stable.
2016-12-07Add support for the new query-based PD v3 decoder API.Uwe Hermann
For the time being, both APIs (2 and 3) will remain supported until all decoders have been converted to API version 3. Then, support for API version 2 will be dropped. Decoders using PD v3 API can benefit from both readability improvements as well as performance improvements. Up to 10x speedup has been measured in some situations (depends a lot on the decoder, the amount of data, the amount of edges in the signals, the amount of oversampling etc. etc.). This is only the first set of (basic) performance improvements for libsigrokdecode, there are various additional opportunities for further changes to improve performance. This changeset has been tested to survive a run of all the test-cases in the sigrok-test repo without issues (for the converted PDs), however it is not very well-tested yet, so there might be regressions that need to be addressed.
2016-08-25Factor out srd_decoder_apiver().Uwe Hermann
2015-10-06exception: Decorate catch function with format attributeDaniel Elstner
2015-10-06util: Factor out Python module loadDaniel Elstner
Create a utility function for loading a Python module by its name in UTF-8.
2015-10-06decoder: Refactor loading code and plug leaksDaniel Elstner
2015-10-06Python: Restrict code to stable ABI subsetDaniel Elstner
Limit usage of the Python C API to the stable ABI subset as defined by PEP 384. This removes some type definitions and functions which libsigrokdecode made use of. Convert all affected code to suitable API alternatives. Also fix a few leaks that became apparent while working on the code. The most visible change is that PyTypeObject is now an opaque type. Thus, the custom Decoder and srd_logic types are now created on the heap via an alternative API. Unfortunately, since tp_name is now inaccessible, type names had to be removed from the log output. Stack traces after Python exceptions are now formatted by calling into Python, since the trace object C API is no longer available.
2015-09-13log: Enable varargs format warningsDaniel Elstner
Decorate srd_log() with the GCC format printf attribute so that the compiler can check the format string and arguments for consistency. Also remove the srd_err(), sr_warn(), etc. functions and replace them with macro wrappers around srd_log().
2015-08-20Pass unitsize per sample chunk.Uwe Hermann
Don't pass unitsize to srd_inst_channel_set_all(), have that only set the channel map. Instead, srd_session_send() now has a parameter for the unitsize which is passed with every new chunk to be decoded. This is in preparation to fix issues with devices or files which have a unitsize != 1 and where the "guessed" unitsize based on the number of channels is not correct. This also allows for (potential) future changes where every chunk can indeed have a different unitsize. This fixes (parts of) bug #352.
2014-08-14Whitespace and consistency fixes.Uwe Hermann
2014-07-08Remove dependency on Python.h from public API headerMarcus Comstedt
This prevents Python.h from being included into client code, where it can mess things up by e.g. redefining _POSIX_C_SOURCE.
2014-05-03Move srd_check_init() to decoder.c and make it static.Uwe Hermann
The function srd_check_init() is only used in decoder.c.
2014-01-30Fix warnings exposed by -Wmissing-prototypes.Uwe Hermann
2013-12-11Easier access to sequences of strings, not just lists.Bert Vermeulen
2013-11-18Check library initialization before handling decodersBert Vermeulen
2013-11-18Clean up prototypesBert Vermeulen
2013-11-16Move session-specific functionality into session.cBert Vermeulen
2013-11-15Prune dead codeBert Vermeulen
2013-10-30Pass metadata to PDs only at runtime, not at decoder startBert Vermeulen
The SRD_CONF_NUM_PROBES metadata key was removed. It wasn't actually used for anything, since this is trivially available via the configured (or default) probe list. The SRD_CONF_UNITSIZE key was removed. The unit size is instead derived from the probe list: the number of probes packed into the least amount of space possible defines the unit size. PD changes: * The start() method no longer takes a 'metadata' parameter. * Metadata now comes in only via the metadata() method, which takes a key and value. The only key defined so far is SRD_CONF_SAMPLERATE, which is exported into the module namespace. API changes: * srd_session_send() now takes an end_samplenum parameter, and had its options rearranged. * srd_session_config_set() is now srd_session_metadata_set(). This keeps "config" options for a future feature to allow PDs or frontends to configure each other's options on the fly, up and down the stack.
2013-10-14Move all decoder instances and callbacks into a session structBert Vermeulen
The struct srd_session also holds configuration parameters formerly passed to srd_session_start(). The new call srd_session_new() takes a pointer where a newly allocated pointer to struct srd_session will be stored. This pointer must be passed as the first argument to all functions that require it. The SRD_CONF_NUM_PROBES, SRD_CONF_UNITSIZE and SRD_CONF_SAMPLERATE keys must be configured with srd_config_set() before srd_session_start() is called. A new call srd_session_destroy() is also available. This cleans up all resources the session holds. This is also called from srd_exit() for all sessions.
2013-09-01Use frontend-registered callback with correct parametersBert Vermeulen
2013-05-03libsigrokdecode-internal.h: Cosmetics.Uwe Hermann
2013-05-03Main header is <libsigrokdecode/libsigrokdecode.h> now.Uwe Hermann
This matches the convention used in libsigrok. Potential other headers might end up in libsigrokdecode/, but only libsigrokdecode.h is meant to be #included by frontends directly.