mirror of
https://github.com/VirusTotal/yara.git
synced 2026-10-11 22:49:58 +00:00
YR_MAJOR_VERSION, YR_MINOR_VERSION and YR_MICRO_VERSION are fixed when the caller is compiled, so a program linked against a shared libyara has no way to tell which version it actually loaded. Distros ship libyara.so in its own package precisely so it can be updated independently of its consumers, which is exactly the case the macros cannot describe. Add yr_get_version(), which reports the version of the library that is actually loaded. Any argument may be NULL if the caller does not need that component, and since the function touches no global state it can be called before yr_initialize. Closes #2136 --------- Co-authored-by: Victor M. Alvarez <[email protected]>