python: rename some public python classes to follow python naming convention

This commit is contained in:
Nguyen Anh Quynh 2013-12-16 10:31:41 +08:00
parent 1d67f0504e
commit 29d138fa2b
6 changed files with 39 additions and 36 deletions

3
.gitignore vendored
View File

@ -36,3 +36,6 @@ tests/test_x86
*.swp
capstone.pc
# local files
_*

View File

@ -4,7 +4,7 @@ import ctypes, copy
from arm_const import *
# define the API
class arm_op_mem(ctypes.Structure):
class ArmOpMem(ctypes.Structure):
_fields_ = (
('base', ctypes.c_uint),
('index', ctypes.c_uint),
@ -12,34 +12,34 @@ class arm_op_mem(ctypes.Structure):
('disp', ctypes.c_int),
)
class arm_op_shift(ctypes.Structure):
class ArmOpShift(ctypes.Structure):
_fields_ = (
('type', ctypes.c_uint),
('value', ctypes.c_uint),
)
class arm_op_value(ctypes.Union):
class ArmOpValue(ctypes.Union):
_fields_ = (
('reg', ctypes.c_uint),
('imm', ctypes.c_int),
('fp', ctypes.c_double),
('mem', arm_op_mem),
('mem', ArmOpMem),
)
class arm_op(ctypes.Structure):
class ArmOp(ctypes.Structure):
_fields_ = (
('shift', arm_op_shift),
('shift', ArmOpShift),
('type', ctypes.c_uint),
('value', arm_op_value),
('value', ArmOpValue),
)
class _cs_arm(ctypes.Structure):
class CsArm(ctypes.Structure):
_fields_ = (
('cc', ctypes.c_uint),
('update_flags', ctypes.c_bool),
('writeback', ctypes.c_bool),
('op_count', ctypes.c_uint8),
('operands', arm_op * 20),
('operands', ArmOp * 20),
)
def get_arch_info(a):

View File

@ -4,42 +4,42 @@ import ctypes, copy
from arm64_const import *
# define the API
class arm64_op_mem(ctypes.Structure):
class Arm64OpMem(ctypes.Structure):
_fields_ = (
('base', ctypes.c_uint),
('index', ctypes.c_uint),
('disp', ctypes.c_int32),
)
class arm64_op_shift(ctypes.Structure):
class Arm64OpShift(ctypes.Structure):
_fields_ = (
('type', ctypes.c_uint),
('value', ctypes.c_uint),
)
class arm64_op_value(ctypes.Union):
class Arm64OpValue(ctypes.Union):
_fields_ = (
('reg', ctypes.c_uint),
('imm', ctypes.c_int32),
('fp', ctypes.c_double),
('mem', arm64_op_mem),
('mem', Arm64OpMem),
)
class arm64_op(ctypes.Structure):
class Arm64Op(ctypes.Structure):
_fields_ = (
('shift', arm64_op_shift),
('shift', Arm64OpShift),
('ext', ctypes.c_uint),
('type', ctypes.c_uint),
('value', arm64_op_value),
('value', Arm64OpValue),
)
class _cs_arm64(ctypes.Structure):
class CsArm64(ctypes.Structure):
_fields_ = (
('cc', ctypes.c_uint),
('update_flags', ctypes.c_bool),
('writeback', ctypes.c_bool),
('op_count', ctypes.c_uint8),
('operands', arm64_op * 8),
('operands', Arm64Op * 8),
)
def get_arch_info(a):

View File

@ -134,10 +134,10 @@ if _found == False:
class _cs_arch(ctypes.Union):
_fields_ = (
('arm64', arm64._cs_arm64),
('arm', arm._cs_arm),
('mips', mips._cs_mips),
('x86', x86._cs_x86),
('arm64', arm64.CsArm64),
('arm', arm.CsArm),
('mips', mips.CsMips),
('x86', x86.CsX86),
)
# low-level structure for C code

View File

@ -4,29 +4,29 @@ import ctypes, copy
from mips_const import *
# define the API
class mips_op_mem(ctypes.Structure):
class MipsOpMem(ctypes.Structure):
_fields_ = (
('base', ctypes.c_uint),
('disp', ctypes.c_int64),
)
class mips_op_value(ctypes.Union):
class MipsOpValue(ctypes.Union):
_fields_ = (
('reg', ctypes.c_uint),
('imm', ctypes.c_int64),
('mem', mips_op_mem),
('mem', MipsOpMem),
)
class mips_op(ctypes.Structure):
class MipsOp(ctypes.Structure):
_fields_ = (
('type', ctypes.c_uint),
('value', mips_op_value),
('value', MipsOpValue),
)
class _cs_mips(ctypes.Structure):
class CsMips(ctypes.Structure):
_fields_ = (
('op_count', ctypes.c_uint8),
('operands', mips_op * 8),
('operands', MipsOp * 8),
)
def get_arch_info(a):

View File

@ -4,7 +4,7 @@ import ctypes, copy
from x86_const import *
# define the API
class x86_op_mem(ctypes.Structure):
class X86OpMem(ctypes.Structure):
_fields_ = (
('base', ctypes.c_uint),
('index', ctypes.c_uint),
@ -12,21 +12,21 @@ class x86_op_mem(ctypes.Structure):
('disp', ctypes.c_int64),
)
class x86_op_value(ctypes.Union):
class X86OpValue(ctypes.Union):
_fields_ = (
('reg', ctypes.c_uint),
('imm', ctypes.c_int64),
('fp', ctypes.c_double),
('mem', x86_op_mem),
('mem', X86OpMem),
)
class x86_op(ctypes.Structure):
class X86Op(ctypes.Structure):
_fields_ = (
('type', ctypes.c_uint),
('value', x86_op_value),
('value', X86OpValue),
)
class _cs_x86(ctypes.Structure):
class CsX86(ctypes.Structure):
_fields_ = (
('prefix', ctypes.c_uint8 * 5),
('segment', ctypes.c_uint),
@ -42,7 +42,7 @@ class _cs_x86(ctypes.Structure):
('sib_scale', ctypes.c_int8),
('sib_base', ctypes.c_uint),
('op_count', ctypes.c_uint8),
('operands', x86_op * 8),
('operands', X86Op * 8),
)
def get_arch_info(a):