Sometimes, we don't have the sources, and we want to check the version
number of the binaries themselves. (For instance when distributing
Monocypher as a library.)
To that end, I've added the global string constant "monocypher_version".
It can be used from the calling program, or scanned directly by tools.
// Monocypher version __git__
+const char *monocypher_version = "__git__";
#include "monocypher.h"
#ifndef MONOCYPHER_H
#define MONOCYPHER_H
+extern const char *monocypher_version;
+
#include <inttypes.h>
#include <stddef.h>
int main(int argc, char *argv[])
{
+ printf("\nMonocypher version: %s\n", monocypher_version);
+
if (argc > 1) {
sscanf(argv[1], "%" PRIu64 "", &random_state);
}