summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/helpers.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-10-10 12:01:40 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-10-10 12:01:40 (GMT)
commit0b0f69bd1278b8f5d95c6ea8fb56915148992a77 (patch)
tree0d9ab819a636c6d7bf61e09856283efd1562353a /plugins/pychrysalide/helpers.h
parent1af362266f616aed07e2661c9676c67dc3365740 (diff)
Updated the basic types definition and its Python bindings.
Diffstat (limited to 'plugins/pychrysalide/helpers.h')
-rw-r--r--plugins/pychrysalide/helpers.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/pychrysalide/helpers.h b/plugins/pychrysalide/helpers.h
index f5b5781..45b3083 100644
--- a/plugins/pychrysalide/helpers.h
+++ b/plugins/pychrysalide/helpers.h
@@ -104,6 +104,19 @@ bool register_python_module_object(PyObject *, PyTypeObject *);
#name "(" args ")\n--\n\n" doc \
}
+#define PYTHON_FALSE_WRAPPER_DEF(name, args, flags, doc)\
+ { \
+ #name, (PyCFunction)py_return_false, \
+ flags, \
+ #name "(" args ")\n--\n\n" doc \
+ }
+
+#define PYTHON_TRUE_WRAPPER_DEF(name, args, flags, doc)\
+ { \
+ #name, (PyCFunction)py_return_true, \
+ flags, \
+ #name "(" args ")\n--\n\n" doc \
+ }
#define PYTHON_GETSET_DEF(name, get, set, doc, closure) \
{ \
@@ -118,6 +131,9 @@ bool register_python_module_object(PyObject *, PyTypeObject *);
#define PYTHON_HAS_DEF_FULL(name, base, doc) \
PYTHON_GETSET_DEF(#name, base ## _has_ ## name, NULL, doc, NULL)
+#define PYTHON_RAWGET_DEF_FULL(name, base, doc) \
+ PYTHON_GETSET_DEF(#name, base ## _ ## name, NULL, doc, NULL)
+
#define PYTHON_GET_DEF_FULL(name, base, doc) \
PYTHON_GETSET_DEF(#name, base ## _get_ ## name, NULL, doc, NULL)
@@ -151,6 +167,12 @@ PyObject *not_yet_implemented_method(PyObject *, PyObject *);
/* Retourne toujours rien. */
PyObject *py_return_none(PyObject *, PyObject *);
+/* Retourne toujours faux. */
+PyObject *py_return_false(PyObject *, PyObject *);
+
+/* Retourne toujours vrai. */
+PyObject *py_return_true(PyObject *, PyObject *);
+
/* Marque l'absence d'implémentation pour un attribut donné. */
PyObject *not_yet_implemented_getter(PyObject *, void *);