summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/analysis/loading.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-07-21 20:21:59 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-07-21 20:21:59 (GMT)
commit6a8385724c74b07cf9ed4cb9052f1af1816e3ea5 (patch)
treea7bea8a4bb9c816da77cf5c3dd44fbd8fb89b3a7 /plugins/pychrysalide/analysis/loading.c
parentf0682e7b195acbd4d83148f3829479d682f9ee9f (diff)
Created more converters for Python arguments.
Diffstat (limited to 'plugins/pychrysalide/analysis/loading.c')
-rw-r--r--plugins/pychrysalide/analysis/loading.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/plugins/pychrysalide/analysis/loading.c b/plugins/pychrysalide/analysis/loading.c
index 0b06bd1..11a9854 100644
--- a/plugins/pychrysalide/analysis/loading.c
+++ b/plugins/pychrysalide/analysis/loading.c
@@ -79,16 +79,14 @@ static PyObject *py_content_explorer_populate_group(PyObject *self, PyObject *ar
{
PyObject *result; /* Valeur à retourner */
unsigned long long wid; /* Identifiant de groupe */
- PyObject *content_obj; /* Nouveau contenu Python */
+ GBinContent *content; /* Contenu nouveau au final */
int ret; /* Bilan de lecture des args. */
GContentExplorer *explorer; /* Explorateur à manipuler */
- GBinContent *content; /* Contenu nouveau au final */
- ret = PyArg_ParseTuple(args, "KO!", &wid, get_python_binary_content_type(), &content_obj);
+ ret = PyArg_ParseTuple(args, "KO&", &wid, convert_to_binary_content, &content);
if (!ret) return NULL;
explorer = G_CONTENT_EXPLORER(pygobject_get(self));
- content = G_BIN_CONTENT(pygobject_get(content_obj));
g_content_explorer_populate_group(explorer, wid, content);
@@ -116,16 +114,14 @@ static PyObject *py_content_explorer_note_detected(PyObject *self, PyObject *arg
{
PyObject *result; /* Valeur à retourner */
unsigned long long wid; /* Identifiant de groupe */
- PyObject *loaded_obj; /* Contenu chargé en Python */
+ GLoadedContent *loaded; /* Contenu chargé au final */
int ret; /* Bilan de lecture des args. */
GContentExplorer *explorer; /* Explorateur à manipuler */
- GLoadedContent *loaded; /* Contenu chargé au final */
- ret = PyArg_ParseTuple(args, "KO!", &wid, get_python_loaded_content_type(), &loaded_obj);
+ ret = PyArg_ParseTuple(args, "KO&", &wid, convert_to_loaded_content, &loaded);
if (!ret) return NULL;
explorer = G_CONTENT_EXPLORER(pygobject_get(self));
- loaded = G_LOADED_CONTENT(pygobject_get(loaded_obj));
g_content_explorer_note_detected(explorer, wid, loaded);
@@ -248,16 +244,14 @@ static PyObject *py_content_resolver_add_detected(PyObject *self, PyObject *args
{
PyObject *result; /* Valeur à retourner */
unsigned long long wid; /* Identifiant de groupe */
- PyObject *loaded_obj; /* Contenu chargé en Python */
+ GLoadedContent *loaded; /* Contenu chargé au final */
int ret; /* Bilan de lecture des args. */
GContentResolver *resolver; /* Résolveur à manipuler */
- GLoadedContent *loaded; /* Contenu chargé au final */
- ret = PyArg_ParseTuple(args, "KO!", &wid, get_python_loaded_content_type(), &loaded_obj);
+ ret = PyArg_ParseTuple(args, "KO&", &wid, convert_to_loaded_content, &loaded);
if (!ret) return NULL;
resolver = G_CONTENT_RESOLVER(pygobject_get(self));
- loaded = G_LOADED_CONTENT(pygobject_get(loaded_obj));
g_content_resolver_add_detected(resolver, wid, loaded);