#include "orconfig.h"
#include "lib/version/torversion.h"
#include "lib/version/git_revision.h"
#include <stdio.h>
#include <string.h>
static const char the_short_tor_version[] =
VERSION
#ifdef TOR_BUILD_TAG
" ("TOR_BUILD_TAG")"
#endif
"";
#define MAX_VERSION_LEN 128
static char the_tor_version[MAX_VERSION_LEN] = "";
const char *
get_version(void)
{
if (the_tor_version[0] == 0) {
if (strlen(tor_git_revision)) {
snprintf(the_tor_version, sizeof(the_tor_version),
"%s (git-%s)", the_short_tor_version, tor_git_revision);
} else {
snprintf(the_tor_version, sizeof(the_tor_version),
"%s", the_short_tor_version);
}
the_tor_version[sizeof(the_tor_version)-1] = 0;
}
return the_tor_version;
}
const char *
get_short_version(void)
{
return the_short_tor_version;
}