summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/pychrysa.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-05-30 11:06:19 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-05-30 11:06:19 (GMT)
commit642ddf810a56900c4554585e1975f9dbc20703f0 (patch)
treef39bfe5b955d16f94eda86bf269c74578da559f1 /plugins/pychrysalide/pychrysa.c
parent92737ef0fa002248b0a656ca441ad5f018a12cf3 (diff)
Created a plugin Python module as a placeholder.
Diffstat (limited to 'plugins/pychrysalide/pychrysa.c')
-rw-r--r--plugins/pychrysalide/pychrysa.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/plugins/pychrysalide/pychrysa.c b/plugins/pychrysalide/pychrysa.c
index f9cdad5..23ec3d7 100644
--- a/plugins/pychrysalide/pychrysa.c
+++ b/plugins/pychrysalide/pychrysa.c
@@ -98,6 +98,9 @@ static bool set_version_for_gtk_namespace(const char *);
/* Point de sortie pour l'initialisation de Python. */
static void PyExit_pychrysalide(void);
+/* Ajoute le module 'plugins' au module Python. */
+static bool add_plugin_module_to_python_module(PyObject *);
+
/* Complète les chemins de recherches de Python. */
static void extend_python_path(const char *);
@@ -329,6 +332,50 @@ static void PyExit_pychrysalide(void)
/******************************************************************************
* *
+* Paramètres : super = module dont la définition est à compléter. *
+* *
+* Description : Ajoute le module 'plugins' au module Python. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static bool add_plugin_module_to_python_module(PyObject *super)
+{
+ bool result; /* Bilan à retourner */
+ PyObject *module; /* Sous-module mis en place */
+
+#define PYCHRYSALIDE_PLUGINS_DOC \
+ "Home for all plugins without another home."
+
+ static PyModuleDef py_chrysalide_deguard_module = {
+
+ .m_base = PyModuleDef_HEAD_INIT,
+
+ .m_name = "pychrysalide.plugins",
+ .m_doc = PYCHRYSALIDE_PLUGINS_DOC,
+
+ .m_size = -1,
+
+ };
+
+ result = false;
+
+ module = build_python_module(super, &py_chrysalide_deguard_module);
+
+ result = (module != NULL);
+
+ assert(result);
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : - *
* *
* Description : Point d'entrée pour l'initialisation de Python. *
@@ -439,6 +486,8 @@ PyMODINIT_FUNC PyInit_pychrysalide(void)
if (status) status = add_features_module(result);
+ if (status) add_plugin_module_to_python_module(result);
+
if (status) status = add_analysis_module(result);
if (status) status = add_arch_module(result);
if (status) status = add_common_module(result);