main.h File Reference

Header file for main.c. More...

Go to the source code of this file.


void handle_signals (void)
void activate_signal (int signal_num)
int try_locking (const or_options_t *options, int err_if_locked)
int have_lockfile (void)
void release_lockfile (void)
void tor_remove_file (const char *filename)
int tor_init (int argc, char **argv)
int run_tor_main_loop (void)
void pubsub_install (void)
void pubsub_connect (void)

Detailed Description

Header file for main.c.

Definition in file main.h.

Function Documentation

◆ handle_signals()

void handle_signals ( void  )

Set up the signal handler events for this process, and register them with libevent if appropriate.

Definition at line 484 of file main.c.

◆ have_lockfile()

int have_lockfile ( void  )

Return true iff we've successfully acquired the lock file.

Definition at line 696 of file main.c.

◆ pubsub_connect()

void pubsub_connect ( void  )

Connect the mainloop to its publish/subscribe message delivery events if appropriate, and configure the global channels appropriately.

Definition at line 1249 of file main.c.

◆ pubsub_install()

void pubsub_install ( void  )

Install the publish/subscribe relationships for all the subsystems.

Definition at line 1237 of file main.c.

◆ release_lockfile()

void release_lockfile ( void  )

If we have successfully acquired the lock file, release it.

Definition at line 703 of file main.c.

◆ tor_remove_file()

void tor_remove_file ( const char *  filename)

Remove the specified file, and log a warning if the operation fails for any reason other than the file not existing. Ignores NULL filenames.

Definition at line 716 of file main.c.

Referenced by tor_cleanup().

◆ try_locking()

int try_locking ( const or_options_t options,
int  err_if_locked 

Try to grab the lock file described in options, if we do not already have it. If err_if_locked is true, warn if somebody else is holding the lock, and exit if we can't get it after waiting. Otherwise, return -1 if we can't get the lockfile. Return 0 on success.

Definition at line 660 of file main.c.