summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/analysis/db/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysa/analysis/db/module.c')
-rw-r--r--plugins/pychrysa/analysis/db/module.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/plugins/pychrysa/analysis/db/module.c b/plugins/pychrysa/analysis/db/module.c
index 8c527a9..08c408c 100644
--- a/plugins/pychrysa/analysis/db/module.c
+++ b/plugins/pychrysa/analysis/db/module.c
@@ -25,8 +25,12 @@
#include "module.h"
+#include <assert.h>
+
+
#include "collection.h"
#include "item.h"
+#include "items/module.h"
@@ -65,28 +69,25 @@ bool add_analysis_db_module_to_python_module(PyObject *super)
if (module == NULL) return false;
ret = PyState_AddModule(super, &py_chrysalide_db_module);
- if (ret != 0) goto aadmtpm_exit;
+ if (ret != 0) goto loading_failed;
ret = _PyImport_FixupBuiltin(module, "pychrysalide.analysis.db");
- if (ret != 0) goto aadmtpm_exit;
+ if (ret != 0) goto loading_failed;
Py_INCREF(module);
ret = PyModule_AddObject(super, "db", module);
- if (ret != 0) goto aadmtpm_exit;
+ if (ret != 0) goto loading_failed;
result = true;
result &= register_python_db_collection(module);
result &= register_python_db_item(module);
- aadmtpm_exit:
+ result &= add_analysis_db_items_module_to_python_module(module);
- if (!result)
- {
- printf("something went wrong in %s...\n", __FUNCTION__);
- /* ... */
+ loading_failed:
- }
+ assert(result);
return result;