summaryrefslogtreecommitdiff
path: root/sigrokdecode.h
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2011-01-28 00:11:00 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2011-01-28 00:11:00 +0100
commit53bec0cfaef9ce8c646deee7d9ba6340137713a1 (patch)
tree2501cb8c3474fc144a022e5b115b5c18e9410915 /sigrokdecode.h
parent76672e26c961d3161b7e67e47d46d0264c9f5c04 (diff)
downloadlibsigrokdecode-53bec0cfaef9ce8c646deee7d9ba6340137713a1.tar.gz
libsigrokdecode-53bec0cfaef9ce8c646deee7d9ba6340137713a1.zip
libsigrokdecode: Always load all decoders upon init.
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.
Diffstat (limited to 'sigrokdecode.h')
-rw-r--r--sigrokdecode.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sigrokdecode.h b/sigrokdecode.h
index 4876b5b..ede6d66 100644
--- a/sigrokdecode.h
+++ b/sigrokdecode.h
@@ -68,7 +68,7 @@ struct sigrokdecode_decoder {
int sigrokdecode_init(void);
GSList *sigrokdecode_list_decoders(void);
-int sigrokdecode_load_decoder(const char *name, struct sigrokdecode_decoder **dec);
+struct sigrokdecode_decoder *sigrokdecode_get_decoder_by_id(const char *id);
int sigrokdecode_run_decoder(struct sigrokdecode_decoder *dec,
uint8_t *inbuf, uint64_t inbuflen,
uint8_t **outbuf, uint64_t *outbuflen);