Anope IRC Services  Version 2.0
Functions | Variables
init.cpp File Reference
#include "services.h"
#include "config.h"
#include "users.h"
#include "protocol.h"
#include "bots.h"
#include "xline.h"
#include "socketengine.h"
#include "servers.h"
#include "language.h"
#include <sys/wait.h>
#include <sys/stat.h>
#include <errno.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
Include dependency graph for init.cpp:

Go to the source code of this file.

Functions

static void ParseCommandLineArguments (int ac, char **av)
 
static bool GetCommandLineArgument (const Anope::string &name, char shortname, Anope::string &param)
 
static bool GetCommandLineArgument (const Anope::string &name, char shortname=0)
 
static void parent_signal_handler (int signal)
 
static void SignalHandler (int sig)
 
static void InitSignals ()
 
static void remove_pidfile ()
 
static void write_pidfile ()
 
static void setuidgid ()
 

Variables

static std::vector< std::pair
< Anope::string, Anope::string > > 
CommandLineArguments
 

Function Documentation

static bool GetCommandLineArgument ( const Anope::string name,
char  shortname,
Anope::string param 
)
static

Check if an argument was given on startup and its parameter

Parameters
nameThe argument name
shortnameA shorter name, eg –debug and -d
paramA string to put the param, if any, of the argument
Returns
true if name/shortname was found, false if not

Definition at line 71 of file init.cpp.

References Anope::string::clear(), and CommandLineArguments.

Referenced by GetCommandLineArgument(), and Anope::Init().

static bool GetCommandLineArgument ( const Anope::string name,
char  shortname = 0 
)
static

Check if an argument was given on startup

Parameters
nameThe argument name
shortnameA shorter name, eg –debug and -d
Returns
true if name/shortname was found, false if not

Definition at line 92 of file init.cpp.

References GetCommandLineArgument().

static void InitSignals ( )
static
static void parent_signal_handler ( int  signal)
static

Definition at line 158 of file init.cpp.

References Anope::Quitting, and Anope::ReturnValue.

Referenced by Anope::Init().

static void ParseCommandLineArguments ( int  ac,
char **  av 
)
static

Called on startup to organize our starting arguments in a better way and check for errors

Parameters
acnumber of args
avargs

Definition at line 43 of file init.cpp.

References Anope::string::begin(), CommandLineArguments, Anope::string::empty(), Anope::string::erase(), Anope::string::find(), Anope::string::npos, and Anope::string::substr().

Referenced by Anope::Init().

static void remove_pidfile ( )
static

Definition at line 205 of file init.cpp.

Referenced by write_pidfile().

static void setuidgid ( )
static
static void SignalHandler ( int  sig)
static

Definition at line 176 of file init.cpp.

References Anope::Signal.

Referenced by InitSignals().

static void write_pidfile ( )
static

Definition at line 212 of file init.cpp.

References remove_pidfile().

Referenced by Anope::Init().

Variable Documentation

std::vector<std::pair<Anope::string, Anope::string> > CommandLineArguments
static

Definition at line 36 of file init.cpp.

Referenced by GetCommandLineArgument(), and ParseCommandLineArguments().