From 451680f192b97d652fb02186f5201efa0d668a2a Mon Sep 17 00:00:00 2001 From: Bert Vermeulen Date: Sun, 15 Jan 2012 03:58:27 +0100 Subject: srd: clean up module loading/unloading, and the decoder struct PDs are now checked for a proper Decoder object, with at least the required attributes. The author, long_desc and func attributes in the decoder object are gone. --- module_sigrokdecode.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'module_sigrokdecode.c') diff --git a/module_sigrokdecode.c b/module_sigrokdecode.c index a18583b..cb43372 100644 --- a/module_sigrokdecode.c +++ b/module_sigrokdecode.c @@ -21,6 +21,12 @@ #include "sigrokdecode-internal.h" #include "config.h" + +/* When initialized, a reference to this module inside the python interpreter + * lives here. + */ +PyObject *mod_sigrokdecode = NULL; + /* lives in type_logic.c */ extern PyTypeObject srd_logic_type; @@ -236,6 +242,8 @@ PyMODINIT_FUNC PyInit_sigrokdecode(void) PyLong_FromLong(SRD_OUTPUT_BINARY)) == -1) return NULL; + mod_sigrokdecode = mod; + return mod; } -- cgit v1.2.3-70-g09d2