summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/arch/operands/register.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/arch/operands/register.c')
-rw-r--r--plugins/pychrysalide/arch/operands/register.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/plugins/pychrysalide/arch/operands/register.c b/plugins/pychrysalide/arch/operands/register.c
index 3e77c9b..28d79f1 100644
--- a/plugins/pychrysalide/arch/operands/register.c
+++ b/plugins/pychrysalide/arch/operands/register.c
@@ -169,6 +169,17 @@ static int py_register_operand_init(PyObject *self, PyObject *args, PyObject *kw
PyObject *new_kwds; /* Nouveau dictionnaire épuré */
GRegisterOperand *operand; /* Opérande à manipuler */
+#define REGISTER_OPERAND_DOC \
+ "The RegisterOperand object handles an operand carrying an" \
+ " architecture register.\n" \
+ "\n" \
+ "Instances can be created using the following constructor:\n" \
+ "\n" \
+ " RegisterOperand(reg)" \
+ "\n" \
+ "Where reg is an architecture register defined from a subclass of" \
+ " pychrysalide.arch.ArchRegister."
+
/* Récupération des paramètres */
ret = PyArg_ParseTuple(args, "O&", convert_to_arch_register, &reg);
@@ -223,6 +234,13 @@ static PyObject *py_register_operand_get_register(PyObject *self, void *closure)
GRegisterOperand *operand; /* Version GLib de l'opérande */
GArchRegister *reg; /* Registre lié à l'opérande */
+#define REGISTER_OPERAND_REGISTER_ATTRIB PYTHON_GET_DEF_FULL \
+( \
+ register, py_register_operand, \
+ "Provide the register used by the operand, as an" \
+ " instance of type pychrysalide.arch.ArchRegister." \
+)
+
operand = G_REGISTER_OPERAND(pygobject_get(self));
reg = g_register_operand_get_register(operand);
@@ -263,10 +281,7 @@ PyTypeObject *get_python_register_operand_type(void)
};
static PyGetSetDef py_register_operand_getseters[] = {
- {
- "register", py_register_operand_get_register, NULL,
- "Provide the register used by the operand.", NULL
- },
+ REGISTER_OPERAND_REGISTER_ATTRIB,
{ NULL }
};
@@ -279,7 +294,7 @@ PyTypeObject *get_python_register_operand_type(void)
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- .tp_doc = "PyChrysalide instruction register operand.",
+ .tp_doc = REGISTER_OPERAND_DOC,
.tp_methods = py_register_operand_methods,
.tp_getset = py_register_operand_getseters,