tor  master
Macros | Functions
tor_api.c File Reference
#include "tor_api.h"
#include "tor_api_internal.h"
#include "orconfig.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for tor_api.c:

Macros

#define raw_malloc   malloc
 
#define raw_free   free
 

Functions

tor_main_configuration_ttor_main_configuration_new (void)
 
int tor_main_configuration_set_command_line (tor_main_configuration_t *cfg, int argc, char *argv[])
 
void tor_main_configuration_free (tor_main_configuration_t *cfg)
 
int tor_main (int argc, char *argv[])
 

Function Documentation

◆ tor_main_configuration_free()

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_new()

tor_main_configuration_t* tor_main_configuration_new ( void  )

Create and return a new tor_main_configuration().

◆ tor_main_configuration_set_command_line()

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.