Merge branch 'issues/152' of https://github.com/JonZeolla/bro into dev/2.7

* 'issues/152' of https://github.com/JonZeolla/bro:
  Bro plugins should support a patch version (x.y.z)
This commit is contained in:
Jon Siwek 2018-10-03 14:32:10 -05:00
commit 92739c1b44
31 changed files with 100 additions and 28 deletions

View file

@ -15,7 +15,7 @@
// Increase this when making incompatible changes to the plugin API. Note
// that the constant is never used in C code. It's picked up on by CMake.
#define BRO_PLUGIN_API_VERSION 6
#define BRO_PLUGIN_API_VERSION 7
#define BRO_PLUGIN_BRO_VERSION BRO_VERSION_FUNCTION
@ -67,18 +67,24 @@ extern const char* hook_name(HookType h);
* Helper class to capture a plugin's version.
* */
struct VersionNumber {
int major; //< Major version number;
int minor; //< Minor version number;
int major; //< Major version number.
int minor; //< Minor version number.
int patch; //< Patch version number (available since Bro 2.7).
/**
* Constructor.
*/
VersionNumber() { major = minor = -1; }
VersionNumber() {
// Major and minor versions are required.
major = minor = -1;
// Patch version is optional, and set to 0 if not manually set.
patch = 0;
}
/**
* Returns true if the version is set to a non-negative value.
*/
explicit operator bool() const { return major >= 0 && minor >= 0; }
explicit operator bool() const { return major >= 0 && minor >= 0 && patch >= 0; }
};
/**