Tor 0.4.9.1-alpha-dev
|
#include "feature/api/tor_api.h"
#include "orconfig.h"
#include "lib/cc/compat_compiler.h"
#include "lib/cc/torint.h"
#include "feature/api/tor_api_internal.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
Macros | |
#define | raw_malloc malloc |
#define | raw_free free |
#define | raw_realloc realloc |
#define | raw_strdup strdup |
#define | raw_socketpair socketpair |
#define | raw_closesocket close |
Functions | |
static int | cfg_add_owned_arg (tor_main_configuration_t *cfg, const char *arg) |
tor_main_configuration_t * | tor_main_configuration_new (void) |
int | tor_main_configuration_set_command_line (tor_main_configuration_t *cfg, int argc, char *argv[]) |
tor_control_socket_t | tor_main_configuration_setup_control_socket (tor_main_configuration_t *cfg) |
void | tor_main_configuration_free (tor_main_configuration_t *cfg) |
const char * | tor_api_get_provider_version (void) |
int | tor_main (int argc, char *argv[]) |
|
static |
const char * tor_api_get_provider_version | ( | void | ) |
Return the name and version of the software implementing the tor_api functionality. Current implementors are "tor" and "libtorrunner".
Note that if you're using libtorrunner, you'll see the version of libtorrunner, not the version of Tor that it's invoking for you.
Added in Tor 0.3.5.1-alpha.
Example return values include "tor 0.3.5.1-alpha" when linked directly against tor, and "libtorrunner 0.3.5.1-alpha" when linked against libtorrunner while it is invoking an arbitrary version of Tor. HOWEVER, the user MUST NOT depend on any particular format or contents of this string: there may be other things that implement Tor in the future.
void tor_main_configuration_free | ( | tor_main_configuration_t * | cfg | ) |
Release all storage held in cfg.
Once you have passed a tor_main_configuration_t to tor_run_main(), you must not free it until tor_run_main() has finished.
tor_main_configuration_t * tor_main_configuration_new | ( | void | ) |
int tor_main_configuration_set_command_line | ( | tor_main_configuration_t * | cfg, |
int | argc, | ||
char * | argv[] | ||
) |
Set the command-line arguments in cfg.
The argc and argv values here are as for main(). The contents of the argv pointer must remain unchanged until tor_run_main() has finished and you call tor_main_configuration_free().
Return 0 on success, -1 on failure.
tor_control_socket_t tor_main_configuration_setup_control_socket | ( | tor_main_configuration_t * | cfg | ) |