summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/format/symbol.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/format/symbol.c')
-rw-r--r--plugins/pychrysalide/format/symbol.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/plugins/pychrysalide/format/symbol.c b/plugins/pychrysalide/format/symbol.c
index 3295e8c..af03473 100644
--- a/plugins/pychrysalide/format/symbol.c
+++ b/plugins/pychrysalide/format/symbol.c
@@ -36,6 +36,7 @@
#include <format/symbol.h>
+#include "constants.h"
#include "../access.h"
#include "../helpers.h"
#include "../analysis/routine.h"
@@ -349,10 +350,16 @@ static PyObject *py_binary_symbol_get_status(PyObject *self, void *closure)
GBinSymbol *symbol; /* Elément à consulter */
SymbolStatus status; /* Visibilité du symbole fourni*/
+#define BINARY_SYMBOL_STATUS_ATTRIB PYTHON_GET_DEF_FULL \
+( \
+ status, py_binary_symbol, \
+ "Status of the symbol's visibility." \
+)
+
symbol = G_BIN_SYMBOL(pygobject_get(self));
status = g_binary_symbol_get_status(symbol);
- result = PyLong_FromLong(status);
+ result = cast_with_constants_group(get_python_binary_symbol_type(), "SymbolStatus", status);
return result;
@@ -432,10 +439,7 @@ PyTypeObject *get_python_binary_symbol_type(void)
"range", py_binary_symbol_get_range, py_binary_symbol_set_range,
"Range covered by the symbol.", NULL
},
- {
- "status", py_binary_symbol_get_status, NULL,
- "Status of the symbol's visibility.", NULL
- },
+ BINARY_SYMBOL_STATUS_ATTRIB,
{ NULL }
};
@@ -498,6 +502,9 @@ bool ensure_python_binary_symbol_is_registered(void)
if (!py_binary_symbol_define_constants(type))
return false;
+ if (!define_binary_symbol_constants(type))
+ return false;
+
}
return true;