From 88778da1a2f9514136ff71dd004da3ccbe8a85a9 Mon Sep 17 00:00:00 2001 From: Damien Dupuis Date: Fri, 29 Jan 2010 08:51:48 +0000 Subject: [PATCH] Added DirectSetBoolAttribute method. I did some tests with it and thought it might be useful. --- .../src/isobar/hurricane/isobar/PyHurricane.h | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/hurricane/src/isobar/hurricane/isobar/PyHurricane.h b/hurricane/src/isobar/hurricane/isobar/PyHurricane.h index f888c9b0..72bdbd59 100644 --- a/hurricane/src/isobar/hurricane/isobar/PyHurricane.h +++ b/hurricane/src/isobar/hurricane/isobar/PyHurricane.h @@ -250,6 +250,26 @@ extern "C" { } +// ------------------------------------------------------------------- +// Attribute Method Macro For Booleans. + +#define DirectSetBoolAttribute(PY_FUNC_NAME,FUNC_NAME,PY_FORMAT,PY_SELF_TYPE,SELF_TYPE) \ + static PyObject* PY_FUNC_NAME ( PY_SELF_TYPE *self, PyObject* args ) \ + { \ + GENERIC_METHOD_HEAD(SELF_TYPE,cobject,"DirectSetBoolAttribute()") \ + \ + PyObject* arg0; \ + if ( ! PyArg_ParseTuple ( args, "O:" PY_FORMAT, &arg0 ) ) \ + return ( NULL ); \ + if(arg0 == Py_True) \ + cobject->FUNC_NAME (true); \ + else \ + cobject->FUNC_NAME (false); \ + \ + Py_RETURN_NONE; \ + } + + // ------------------------------------------------------------------- // Attribute Method Macro For Long.