]> sigrok.org Git - libsigrokdecode.git/commitdiff
libsigrokdecode: Always load all decoders upon init.
authorUwe Hermann <redacted>
Thu, 27 Jan 2011 23:11:00 +0000 (00:11 +0100)
committerUwe Hermann <redacted>
Thu, 27 Jan 2011 23:11:00 +0000 (00:11 +0100)
Let sigrokdecode_init() always load all decoders it can find in the
decoders directory, i.e., the user doesn't need to manually load decoders.
Instead he can just look up the list via sigrokdecode_list_decoders()
after sigrokdecode_init() has run.

This is not a problem, as sigrokdecode_init() is only run once per
sigrok-cli or sigrok-gui invocation, and even with many decoders this
should not take too long.

The list of decoders within libsigrokdecode is no longer a string, but
rather a list of 'struct sigrokdecode_decoder *' pointers.

Add sigrokdecode_get_decoder_by_id() API function which returns the
decoder with the specified ID (file name without ".py" suffix, for now),
or NULL if it cannot be found.

sigrokdecode_load_decoder() is now a private function and not exported
via the lib, i.e. not available to users of libsigrokdecode.


No differences found