summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/helpers.h
diff options
context:
space:
mode:
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 *);