summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/arch/instruction.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/arch/instruction.c')
-rw-r--r--plugins/pychrysalide/arch/instruction.c40
1 files changed, 2 insertions, 38 deletions
diff --git a/plugins/pychrysalide/arch/instruction.c b/plugins/pychrysalide/arch/instruction.c
index 757949a..3b3033f 100644
--- a/plugins/pychrysalide/arch/instruction.c
+++ b/plugins/pychrysalide/arch/instruction.c
@@ -35,6 +35,7 @@
#include <plugins/dt.h>
+#include "constants.h"
#include "operand.h"
#include "vmpa.h"
#include "../access.h"
@@ -149,9 +150,6 @@ static int py_arch_instruction_set_range(PyObject *, PyObject *, void *);
/* Fournit le nom humain de l'instruction manipulée. */
static PyObject *py_arch_instruction_get_keyword(PyObject *, void *);
-/* Définit les constantes pour les instructions. */
-static bool py_arch_instruction_define_constants(PyTypeObject *);
-
/* ---------------------------------------------------------------------------------- */
@@ -839,40 +837,6 @@ static PyObject *py_arch_instruction_get_keyword(PyObject *self, void *unused)
/******************************************************************************
* *
-* Paramètres : obj_type = type dont le dictionnaire est à compléter. *
-* *
-* Description : Définit les constantes pour les instructions. *
-* *
-* Retour : true en cas de succès de l'opération, false sinon. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool py_arch_instruction_define_constants(PyTypeObject *obj_type)
-{
- bool result; /* Bilan à retourner */
-
- result = true;
-
- result &= PyDict_AddULongMacro(obj_type, ILT_EXEC_FLOW);
- result &= PyDict_AddULongMacro(obj_type, ILT_JUMP);
- result &= PyDict_AddULongMacro(obj_type, ILT_CASE_JUMP);
- result &= PyDict_AddULongMacro(obj_type, ILT_JUMP_IF_TRUE);
- result &= PyDict_AddULongMacro(obj_type, ILT_JUMP_IF_FALSE);
- result &= PyDict_AddULongMacro(obj_type, ILT_LOOP);
- result &= PyDict_AddULongMacro(obj_type, ILT_CALL);
- result &= PyDict_AddULongMacro(obj_type, ILT_CATCH_EXCEPTION);
- result &= PyDict_AddULongMacro(obj_type, ILT_REF);
- result &= PyDict_AddULongMacro(obj_type, ILT_COUNT);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
* Paramètres : - *
* *
* Description : Fournit un accès à une définition de type à diffuser. *
@@ -989,7 +953,7 @@ bool ensure_python_arch_instruction_is_registered(void)
&PyGObject_Type, get_python_line_generator_type(), NULL))
return false;
- if (!py_arch_instruction_define_constants(type))
+ if (!define_arch_instruction_constants(type))
return false;
}