move internal memory management declarations from utils.h to cs_priv.h
diff --git a/arch/AArch64/AArch64InstPrinter.c b/arch/AArch64/AArch64InstPrinter.c
index 5404abd..b5bd056 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 28f9252..73ad300 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 f81d78b..60f9654 100644
--- a/arch/AArch64/module.c
+++ b/arch/AArch64/module.c
@@ -1,7 +1,6 @@
/* Capstone Disassembler Engine */
/* By Dang Hoang Vu <danghvu@gmail.com> 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 26141cb..e3f7d49 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 c7d9a5b..806a8b7 100644
--- a/arch/Mips/MipsDisassembler.c
+++ b/arch/Mips/MipsDisassembler.c
@@ -21,7 +21,7 @@
#include <inttypes.h>
-#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 976afa1..f7048bf 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 2b2b0a8..13fbd67 100644
--- a/arch/Mips/module.c
+++ b/arch/Mips/module.c
@@ -1,7 +1,6 @@
/* Capstone Disassembler Engine */
/* By Dang Hoang Vu <danghvu@gmail.com> 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 475895f..080c8e4 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 46d3dd2..f63331e 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 96fa5b2..9ab6211 100644
--- a/arch/PowerPC/module.c
+++ b/arch/PowerPC/module.c
@@ -1,7 +1,6 @@
/* Capstone Disassembler Engine */
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 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 0ea263a..de9aabd 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 b6e7afc..e33bb9b 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 cf284b3..eb0f6a1 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 fca0f12..76cab6a 100644
--- a/cs.c
+++ b/cs.c
@@ -7,11 +7,8 @@
#include <string.h>
#include <capstone.h>
-#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 b80b7f8..56b98a4 100644
--- a/cs_priv.h
+++ b/cs_priv.h
@@ -59,4 +59,9 @@
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 582e3d0..8df745e 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 @@
#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