summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <Uwe@.(none)>2010-04-23 18:06:22 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2010-04-23 19:38:49 +0200
commit2b45dd716c3f27a62d163de7ec12f6c225ef4e39 (patch)
treefb9ad8234ee34b942c91a2226004f98aada8a73f
parent33e72c5440ab5973bcb99b5c133e0cdcf15636e8 (diff)
downloadlibsigrokdecode-2b45dd716c3f27a62d163de7ec12f6c225ef4e39.tar.gz
libsigrokdecode-2b45dd716c3f27a62d163de7ec12f6c225ef4e39.zip
sigrokdecode_run_decoder(): Pass in the module name.
-rw-r--r--decode.c10
-rw-r--r--sigrokdecode.h6
2 files changed, 7 insertions, 9 deletions
diff --git a/decode.c b/decode.c
index ab412f6..d87f5d2 100644
--- a/decode.c
+++ b/decode.c
@@ -68,12 +68,10 @@ int sigrokdecode_load_decoder_file(const char *name)
* @param outbuflen TODO
* @return 0 upon success, non-zero otherwise.
*/
-int sigrokdecode_run_decoder(const char *decodername, uint8_t *inbuf,
- uint64_t inbuflen, uint8_t **outbuf,
- uint64_t *outbuflen)
+int sigrokdecode_run_decoder(const char *modulename, const char *decodername,
+ uint8_t *inbuf, uint64_t inbuflen,
+ uint8_t **outbuf, uint64_t *outbuflen)
{
- const char *decoder_filename = "transitioncounter"; /* FIXME */
- // const char *decoder_filename = "i2c"; /* FIXME */
PyObject *py_name, *py_module, *py_func, *py_args;
PyObject *py_value, *py_result;
int ret;
@@ -93,7 +91,7 @@ int sigrokdecode_run_decoder(const char *decodername, uint8_t *inbuf,
return -5;
/* Get the name of the decoder module/file as Python string. */
- if (!(py_name = PyString_FromString(decoder_filename))) {
+ if (!(py_name = PyString_FromString(modulename))) {
PyErr_Print();
return -6;
}
diff --git a/sigrokdecode.h b/sigrokdecode.h
index 25fdb4d..4c30c34 100644
--- a/sigrokdecode.h
+++ b/sigrokdecode.h
@@ -47,9 +47,9 @@
int sigrokdecode_init(void);
int sigrokdecode_load_decoder_file(const char *name);
-int sigrokdecode_run_decoder(const char *decodername, uint8_t *inbuf,
- uint64_t inbuflen, uint8_t **outbuf,
- uint64_t *outbuflen);
+int sigrokdecode_run_decoder(const char *modulename, const char *decodername,
+ uint8_t *inbuf, uint64_t inbuflen,
+ uint8_t **outbuf, uint64_t *outbuflen);
int sigrokdecode_shutdown(void);
#endif