diff --git a/arch/AArch64/AArch64InstPrinter.c b/arch/AArch64/AArch64InstPrinter.c index 5404abd5..b5bd0561 100644 --- a/arch/AArch64/AArch64InstPrinter.c +++ b/arch/AArch64/AArch64InstPrinter.c @@ -20,12 +20,11 @@ #include "AArch64InstPrinter.h" #include "AArch64BaseInfo.h" +#include "../../utils.h" #include "../../MCInst.h" -#include "../../cs_priv.h" #include "../../SStream.h" #include "../../MCRegisterInfo.h" #include "../../MathExtras.h" -#include "../../utils.h" #include "mapping.h" diff --git a/arch/AArch64/mapping.c b/arch/AArch64/mapping.c index 28f92524..73ad3003 100644 --- a/arch/AArch64/mapping.c +++ b/arch/AArch64/mapping.c @@ -6,7 +6,6 @@ #include "../../include/arm64.h" #include "../../utils.h" -#include "../../cs_priv.h" #include "mapping.h" diff --git a/arch/AArch64/module.c b/arch/AArch64/module.c index f81d78ba..60f96549 100644 --- a/arch/AArch64/module.c +++ b/arch/AArch64/module.c @@ -1,7 +1,6 @@ /* Capstone Disassembler Engine */ /* By Dang Hoang Vu 2013 */ -#include "../../cs_priv.h" #include "../../utils.h" #include "../../MCRegisterInfo.h" #include "AArch64Disassembler.h" diff --git a/arch/ARM/ARMInstPrinter.c b/arch/ARM/ARMInstPrinter.c index 26141cba..e3f7d49f 100644 --- a/arch/ARM/ARMInstPrinter.c +++ b/arch/ARM/ARMInstPrinter.c @@ -29,7 +29,6 @@ #include "../../MCRegisterInfo.h" #include "../../utils.h" #include "mapping.h" -#include "../../cs_priv.h" #define GET_SUBTARGETINFO_ENUM #include "ARMGenSubtargetInfo.inc" diff --git a/arch/Mips/MipsDisassembler.c b/arch/Mips/MipsDisassembler.c index c7d9a5b6..806a8b78 100644 --- a/arch/Mips/MipsDisassembler.c +++ b/arch/Mips/MipsDisassembler.c @@ -21,7 +21,7 @@ #include -#include "../../cs_priv.h" +#include "../../utils.h" #include "../../SubtargetFeature.h" #include "../../MCInst.h" @@ -29,7 +29,6 @@ #include "../../SStream.h" #include "../../MathExtras.h" -#include "../../utils.h" //#include "Mips.h" //#include "MipsRegisterInfo.h" diff --git a/arch/Mips/MipsInstPrinter.c b/arch/Mips/MipsInstPrinter.c index 976afa13..f7048bf5 100644 --- a/arch/Mips/MipsInstPrinter.c +++ b/arch/Mips/MipsInstPrinter.c @@ -21,10 +21,9 @@ #include "MipsInstPrinter.h" #include "../../MCInst.h" -#include "../../cs_priv.h" +#include "../../utils.h" #include "../../SStream.h" #include "../../MCRegisterInfo.h" -#include "../../utils.h" #include "mapping.h" #include "MipsInstPrinter.h" diff --git a/arch/Mips/module.c b/arch/Mips/module.c index 2b2b0a8c..13fbd671 100644 --- a/arch/Mips/module.c +++ b/arch/Mips/module.c @@ -1,7 +1,6 @@ /* Capstone Disassembler Engine */ /* By Dang Hoang Vu 2013 */ -#include "../../cs_priv.h" #include "../../utils.h" #include "../../MCRegisterInfo.h" #include "MipsDisassembler.h" diff --git a/arch/PowerPC/PPCInstPrinter.c b/arch/PowerPC/PPCInstPrinter.c index 475895fc..080c8e46 100644 --- a/arch/PowerPC/PPCInstPrinter.c +++ b/arch/PowerPC/PPCInstPrinter.c @@ -21,11 +21,10 @@ #include "PPCInstPrinter.h" #include "PPCPredicates.h" #include "../../MCInst.h" -#include "../../cs_priv.h" +#include "../../utils.h" #include "../../SStream.h" #include "../../MCRegisterInfo.h" #include "../../MathExtras.h" -#include "../../utils.h" #include "mapping.h" //#include "mapping.h" diff --git a/arch/PowerPC/mapping.c b/arch/PowerPC/mapping.c index 46d3dd2b..f63331ee 100644 --- a/arch/PowerPC/mapping.c +++ b/arch/PowerPC/mapping.c @@ -6,7 +6,6 @@ #include "../../include/ppc.h" #include "../../utils.h" -#include "../../cs_priv.h" #include "mapping.h" diff --git a/arch/PowerPC/module.c b/arch/PowerPC/module.c index 96fa5b28..9ab62116 100644 --- a/arch/PowerPC/module.c +++ b/arch/PowerPC/module.c @@ -1,7 +1,6 @@ /* Capstone Disassembler Engine */ /* By Nguyen Anh Quynh , 2013 */ -#include "../../cs_priv.h" #include "../../utils.h" #include "../../MCRegisterInfo.h" #include "PPCDisassembler.h" diff --git a/arch/X86/X86ATTInstPrinter.c b/arch/X86/X86ATTInstPrinter.c index 0ea263a5..de9aabd6 100644 --- a/arch/X86/X86ATTInstPrinter.c +++ b/arch/X86/X86ATTInstPrinter.c @@ -23,7 +23,6 @@ #include "../../utils.h" #include "../../MCInst.h" -#include "../../cs_priv.h" #include "../../SStream.h" #include "../../MCRegisterInfo.h" #include "mapping.h" diff --git a/arch/X86/X86IntelInstPrinter.c b/arch/X86/X86IntelInstPrinter.c index b6e7afc1..e33bb9b7 100644 --- a/arch/X86/X86IntelInstPrinter.c +++ b/arch/X86/X86IntelInstPrinter.c @@ -23,7 +23,6 @@ #include "../../utils.h" #include "../../MCInst.h" -#include "../../cs_priv.h" #include "../../SStream.h" #include "mapping.h" diff --git a/arch/X86/mapping.c b/arch/X86/mapping.c index cf284b33..eb0f6a12 100644 --- a/arch/X86/mapping.c +++ b/arch/X86/mapping.c @@ -7,7 +7,6 @@ #include "X86DisassemblerDecoder.h" #include "../../utils.h" -#include "../../cs_priv.h" #include "../../include/x86.h" static x86_reg sib_base_map[] = { diff --git a/cs.c b/cs.c index fca0f120..76cab6a9 100644 --- a/cs.c +++ b/cs.c @@ -7,11 +7,8 @@ #include #include -#include "cs_priv.h" - -#include "MCRegisterInfo.h" - #include "utils.h" +#include "MCRegisterInfo.h" cs_err (*arch_init[MAX_ARCH])(cs_struct *) = { NULL }; cs_err (*arch_option[MAX_ARCH]) (cs_struct *, cs_opt_type, size_t value) = { NULL }; diff --git a/cs_priv.h b/cs_priv.h index b80b7f8c..56b98a4a 100644 --- a/cs_priv.h +++ b/cs_priv.h @@ -59,4 +59,9 @@ extern void (*arch_destroy[MAX_ARCH]) (cs_struct*); extern unsigned int all_arch; +extern malloc_t my_malloc; +extern calloc_t my_calloc; +extern realloc_t my_realloc; +extern free_t my_free; + #endif diff --git a/utils.h b/utils.h index 582e3d0e..8df745ea 100644 --- a/utils.h +++ b/utils.h @@ -5,6 +5,7 @@ #define CS_UTILS_H #include "include/capstone.h" +#include "cs_priv.h" // threshold number, so above this number will be printed in hexa mode #define HEX_THRESHOLD 9 @@ -48,10 +49,5 @@ unsigned int count_positive(unsigned char *list); #define ARR_SIZE(a) (sizeof(a)/sizeof(a[0])) -extern malloc_t my_malloc; -extern calloc_t my_calloc; -extern realloc_t my_realloc; -extern free_t my_free; - #endif