2009-07-21 18:45:58 +00:00
|
|
|
// Convert op_t char members to integers
|
2009-07-21 18:38:51 +00:00
|
|
|
%apply unsigned char { char n };
|
|
|
|
%apply unsigned char { char offb };
|
|
|
|
%apply unsigned char { char offo };
|
|
|
|
%apply unsigned char { char dtyp };
|
2009-07-21 18:45:58 +00:00
|
|
|
// Convert insn_t char members to integers
|
|
|
|
%apply unsigned char { char segpref };
|
|
|
|
%apply unsigned char { char insnpref };
|
|
|
|
%apply unsigned char { char flags };
|
2009-01-19 19:41:24 +00:00
|
|
|
|
2007-10-20 07:03:51 +00:00
|
|
|
%include "ua.hpp"
|
|
|
|
|
2009-07-21 18:38:51 +00:00
|
|
|
%clear (char n);
|
|
|
|
%clear (char offb);
|
|
|
|
%clear (char offo);
|
|
|
|
%clear (char dtyp);
|
|
|
|
|
2009-07-21 18:45:58 +00:00
|
|
|
%clear (segpref);
|
|
|
|
%clear (insnpref);
|
|
|
|
%clear (flags);
|
|
|
|
|
2007-10-20 07:03:51 +00:00
|
|
|
// Small function to get the global cmd pointer
|
|
|
|
// In Python it returns an insn_t class instance
|
|
|
|
%inline {
|
|
|
|
insn_t * get_current_instruction()
|
|
|
|
{
|
2009-05-23 16:35:50 +00:00
|
|
|
return &cmd;
|
2007-10-20 07:03:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get the nth operand from the insn_t class
|
|
|
|
%inline {
|
|
|
|
op_t *get_instruction_operand(insn_t *ins, int n)
|
|
|
|
{
|
2009-05-23 16:35:50 +00:00
|
|
|
if (!ins)
|
|
|
|
return NULL;
|
|
|
|
return &(ins->Operands[n]);
|
2007-10-20 07:03:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|