diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-01-26 09:19:53 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-01-26 09:19:53 (GMT) |
commit | dff8fd4c83d9833d4539e2dd0c9d3f998b73608f (patch) | |
tree | 5e1088e0572b1e921df6d31d3db3ef753d97555b /src/arch/instruction.h | |
parent | ae3725eae3c1f2008e6f26b1057d97a6b9050a3c (diff) |
Extended the Python API.
Diffstat (limited to 'src/arch/instruction.h')
-rw-r--r-- | src/arch/instruction.h | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/src/arch/instruction.h b/src/arch/instruction.h index 8289a43..217e38b 100644 --- a/src/arch/instruction.h +++ b/src/arch/instruction.h @@ -148,38 +148,46 @@ size_t _g_arch_instruction_count_operands(const GArchInstruction *); GArchOperand *_g_arch_instruction_get_operand(const GArchInstruction *, size_t); /* Remplace un opérande d'une instruction par un autre. */ -bool g_arch_instruction_replace_operand(GArchInstruction *, GArchOperand *, GArchOperand *); - -/* Remplace un opérande d'une instruction par un autre. */ bool _g_arch_instruction_replace_operand(GArchInstruction *, GArchOperand *, GArchOperand *); /* Détache un opérande liée d'une instruction. */ -void _g_arch_instruction_detach_operand(GArchInstruction *, GArchOperand *); +bool _g_arch_instruction_detach_operand(GArchInstruction *, GArchOperand *); -#define g_arch_instruction_count_operands(ins) \ - ({ \ - size_t __result; \ - g_arch_instruction_lock_operands(ins); \ - __result = _g_arch_instruction_count_operands(ins); \ - g_arch_instruction_unlock_operands(ins); \ - __result; \ +#define g_arch_instruction_count_operands(ins) \ + ({ \ + size_t __result; \ + g_arch_instruction_lock_operands(ins); \ + __result = _g_arch_instruction_count_operands(ins); \ + g_arch_instruction_unlock_operands(ins); \ + __result; \ + }) + +#define g_arch_instruction_get_operand(ins, idx) \ + ({ \ + GArchOperand *__result; \ + g_arch_instruction_lock_operands(ins); \ + __result = _g_arch_instruction_get_operand(ins, idx); \ + g_arch_instruction_unlock_operands(ins); \ + __result; \ }) -#define g_arch_instruction_get_operand(ins, idx) \ - ({ \ - GArchOperand *__result; \ - g_arch_instruction_lock_operands(ins); \ - __result = _g_arch_instruction_get_operand(ins, idx); \ - g_arch_instruction_unlock_operands(ins); \ - __result; \ +#define g_arch_instruction_replace_operand(ins, o, n) \ + ({ \ + bool __result; \ + g_arch_instruction_lock_operands(ins); \ + __result = _g_arch_instruction_replace_operand(ins, o, n); \ + g_arch_instruction_unlock_operands(ins); \ + __result; \ }) -#define g_arch_instruction_detach_operand(ins, o) \ - ({ \ - g_arch_instruction_lock_operands(ins); \ - _g_arch_instruction_detach_operand(ins, o); \ - g_arch_instruction_unlock_operands(ins); \ +#define g_arch_instruction_detach_operand(ins, o) \ + ({ \ + bool __result; \ + g_arch_instruction_lock_operands(ins); \ + __result = _g_arch_instruction_detach_operand(ins, o); \ + g_arch_instruction_unlock_operands(ins); \ + __result; \ }) |