summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/analysis
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-05-11 21:33:36 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-05-11 21:33:36 (GMT)
commitd2861533cc53fbcc217048bafebf34b1f70ba3aa (patch)
tree28c847a8093761fcaa0916be54445328d843096d /plugins/pychrysalide/analysis
parent6c9e1b5f7ee0915036d47b83f1e34b87b44b1723 (diff)
Updated the API for buffer caches.
Diffstat (limited to 'plugins/pychrysalide/analysis')
-rw-r--r--plugins/pychrysalide/analysis/content.c31
-rw-r--r--plugins/pychrysalide/analysis/content.h3
2 files changed, 34 insertions, 0 deletions
diff --git a/plugins/pychrysalide/analysis/content.c b/plugins/pychrysalide/analysis/content.c
index a0eb11c..8a404ed 100644
--- a/plugins/pychrysalide/analysis/content.c
+++ b/plugins/pychrysalide/analysis/content.c
@@ -813,3 +813,34 @@ int convert_to_binary_content(PyObject *arg, void *dst)
return result;
}
+
+
+/******************************************************************************
+* *
+* Paramètres : arg = argument quelconque à tenter de convertir. *
+* dst = destination des valeurs récupérées en cas de succès. *
+* *
+* Description : Tente de convertir en contenu binaire ou NULL. *
+* *
+* Retour : Bilan de l'opération, voire indications supplémentaires. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+int convert_to_binary_content_or_none(PyObject *arg, void *dst)
+{
+ int result; /* Bilan à retourner */
+
+ if (arg == Py_None)
+ {
+ *((GBinContent **)dst) = NULL;
+ result = 1;
+ }
+
+ else
+ result = convert_to_binary_content(arg, dst);
+
+ return result;
+
+}
diff --git a/plugins/pychrysalide/analysis/content.h b/plugins/pychrysalide/analysis/content.h
index e56e29f..fab6b1b 100644
--- a/plugins/pychrysalide/analysis/content.h
+++ b/plugins/pychrysalide/analysis/content.h
@@ -40,6 +40,9 @@ bool ensure_python_binary_content_is_registered(void);
/* Tente de convertir en contenu binaire. */
int convert_to_binary_content(PyObject *, void *);
+/* Tente de convertir en contenu binaire ou NULL. */
+int convert_to_binary_content_or_none(PyObject *, void *);
+
#endif /* _PLUGINS_PYCHRYSALIDE_ANALYSIS_CONTENT_H */