From 871d21e2555c345350ec951f1639b4a75dbd4fea Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sat, 15 Jan 2011 02:37:51 +0100 Subject: Don't expose libsigrokdecode's interal GSList. Instead, add a libsigrokdecode_list_decoders() API call which gives you the list of known protocol decoders. --- decode.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'decode.c') diff --git a/decode.c b/decode.c index 536be2c..7125d32 100644 --- a/decode.c +++ b/decode.c @@ -31,7 +31,7 @@ #endif /* The list of protocol decoders. */ -GSList *list_pds; +GSList *list_pds = NULL; /** * Initialize libsigrokdecode. @@ -70,6 +70,18 @@ int sigrokdecode_init(void) return SIGROKDECODE_OK; } +/** + * Returns the list of supported/loaded protocol decoders. + * + * This is a GSList containing the names of the decoders as strings. + * + * @return List of decoders, NULL if none are supported or loaded. + */ +GSList *sigrokdecode_list_decoders(void) +{ + return list_pds; +} + /** * Helper function to handle Python strings. * -- cgit v1.2.3-70-g09d2