Tor  0.4.6.0-alpha-dev
Macros | Functions | Variables
version.c File Reference

Functions to get the version of Tor. More...

#include "orconfig.h"
#include "lib/version/torversion.h"
#include "lib/version/git_revision.h"
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Macros

#define MAX_VERSION_LEN   128
 

Functions

const char * get_version (void)
 
const char * get_short_version (void)
 

Variables

static const char the_short_tor_version []
 
static char the_tor_version [MAX_VERSION_LEN] = ""
 

Detailed Description

Functions to get the version of Tor.

Definition in file version.c.

Macro Definition Documentation

◆ MAX_VERSION_LEN

#define MAX_VERSION_LEN   128

Longest possible version length. We make this a constant so that we can statically allocate the_tor_version.

Definition at line 31 of file version.c.

Function Documentation

◆ get_short_version()

const char* get_short_version ( void  )

Return the current Tor version, without any git tag.

Definition at line 56 of file version.c.

Referenced by get_platform_str().

◆ get_version()

const char* get_version ( void  )

Return the current Tor version.

Definition at line 38 of file version.c.

Referenced by options_init_from_torrc(), print_library_versions(), and tor_init().

Variable Documentation

◆ the_short_tor_version

const char the_short_tor_version[]
static
Initial value:
=
VERSION
""

A shorter version of this Tor process's version, for export in our router descriptor. (Does not include the git version, if any.)

Definition at line 20 of file version.c.

Referenced by get_short_version(), and get_version().

◆ the_tor_version

char the_tor_version[MAX_VERSION_LEN] = ""
static

The version of this Tor process, possibly including git version

Definition at line 34 of file version.c.

Referenced by get_version().