diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-01-15 19:19:40 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-01-15 19:19:40 (GMT) |
commit | d75fe33356f22c1c41925bffe179a55b9cea6cd1 (patch) | |
tree | 37b9a32d3a2b688326791392b338e025bb4c84f3 /plugins/pychrysalide/arch/operands/register.c | |
parent | 55935908085677432f746f8378e600f4fd8234b0 (diff) |
Reorganized the architecture operands.
Diffstat (limited to 'plugins/pychrysalide/arch/operands/register.c')
-rw-r--r-- | plugins/pychrysalide/arch/operands/register.c | 25 |
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, ®); @@ -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, |