diff --git a/bindings/python/capstone/__init__.py b/bindings/python/capstone/__init__.py index 238444e395..64af3f2172 100644 --- a/bindings/python/capstone/__init__.py +++ b/bindings/python/capstone/__init__.py @@ -19,6 +19,10 @@ 'CS_API_MAJOR', 'CS_API_MINOR', + 'CS_VERSION_MAJOR', + 'CS_VERSION_MINOR', + 'CS_VERSION_EXTRA', + 'CS_ARCH_ARM', 'CS_ARCH_ARM64', 'CS_ARCH_MIPS', @@ -100,7 +104,12 @@ CS_API_MAJOR = 3 CS_API_MINOR = 0 -__version__ = "%s.%s" %(CS_API_MAJOR, CS_API_MINOR) +# Package version +CS_VERSION_MAJOR = CS_API_MAJOR +CS_VERSION_MINOR = CS_API_MINOR +CS_VERSION_EXTRA = 5 + +__version__ = "%u.%u.%u" %(CS_VERSION_MAJOR, CS_VERSION_MINOR, CS_VERSION_EXTRA) # architectures CS_ARCH_ARM = 0 diff --git a/cstool/cstool.c b/cstool/cstool.c index d981f3d252..92c55a9414 100644 --- a/cstool/cstool.c +++ b/cstool/cstool.c @@ -73,7 +73,7 @@ static uint8_t *preprocess(char *code, size_t *size) static void usage(char *prog) { - printf("Cstool v%s for Capstone Disassembler Engine (core v%u.%u)\n\n", VERSION, CS_API_MAJOR, CS_API_MINOR); + printf("Cstool v%s for Capstone Disassembler Engine (core v%u.%u.%u)\n\n", VERSION, CS_VERSION_MAJOR, CS_VERSION_MINOR, CS_VERSION_EXTRA); printf("Syntax: %s [-d] [start-address-in-hex-format]\n", prog); printf("\nThe following options are supported:\n"); diff --git a/include/capstone.h b/include/capstone.h index 81c4af351f..0d5f63bcd9 100644 --- a/include/capstone.h +++ b/include/capstone.h @@ -54,6 +54,11 @@ extern "C" { #define CS_API_MAJOR 3 #define CS_API_MINOR 0 +// Capstone package version +#define CS_VERSION_MAJOR CS_API_MAJOR +#define CS_VERSION_MINOR CS_API_MINOR +#define CS_VERSION_EXTRA 5 + // Macro to create combined version which can be compared to // result of cs_version() API. #define CS_MAKE_VERSION(major, minor) ((major << 8) + minor)