Defines | Functions | Variables

extern.h File Reference

#include "modes.h"
Include dependency graph for extern.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define E   extern CoreExport
#define EI   extern DllExport

Functions

E bool bad_password (User *u)
E void common_unban (const ChannelInfo *ci, User *u, bool full=false)
E void enc_encrypt (const Anope::string &src, Anope::string &dest)
E bool enc_decrypt (const Anope::string &src, Anope::string &dest)
E void introduce_user (const Anope::string &user)
E bool GetCommandLineArgument (const Anope::string &name, char shortname=0)
E bool GetCommandLineArgument (const Anope::string &name, char shortname, Anope::string &param)
E bool AtTerm ()
E void Fork ()
E void Init (int ac, char **av)
E void InitLanguages ()
E const char * translate (const char *string)
E const char * translate (User *u, const char *string)
E const char * translate (const NickCore *nc, const char *string)
E const char * anope_gettext (const char *lang, const char *string)
E void save_databases ()
E void sighandler (int signum)
E bool IsFile (const Anope::string &filename)
E time_t dotime (const Anope::string &s)
E Anope::string duration (const time_t &seconds, const NickCore *nc=NULL)
E Anope::string expire_left (const NickCore *nc, time_t expires)
E Anope::string do_strftime (const time_t &t, const NickCore *nc=NULL, bool short_output=false)
E bool IsValidIdent (const Anope::string &ident)
E bool IsValidHost (const Anope::string &host)
E Anope::string myStrGetToken (const Anope::string &str, char dilim, int token_number)
E Anope::string myStrGetTokenRemainder (const Anope::string &str, char dilim, int token_number)
E int myNumToken (const Anope::string &str, char dilim)
E bool nickIsServices (const Anope::string &nick, bool bot)
E std::list< Anope::stringBuildStringList (const Anope::string &, char= ' ')
E std::vector< Anope::stringBuildStringVector (const Anope::string &, char= ' ')
E bool str_is_wildcard (const Anope::string &str)
E bool str_is_pure_wildcard (const Anope::string &str)
E Anope::string normalizeBuffer (const Anope::string &)
E void SetDefaultMLock (ServerConfig *config)
E void process (const Anope::string &buf)

Variables

E Anope::string conf_dir
E Anope::string db_dir
E Anope::string modules_dir
E Anope::string locale_dir
E Anope::string log_dir
E std::vector< Anope::stringlanguages
E std::vector< Anope::stringdomains
E Anope::string services_dir
E Anope::string services_bin
E int debug
E bool readonly
E bool nofork
E bool nothird
E bool noexpire
E bool protocoldebug
E bool quitting
E int return_code
E bool restarting
E Anope::string quitmsg
E time_t start_time
E int CurrentUplink
E unsigned GenericChannelModes
E unsigned GenericUserModes
E std::multimap
< ChannelModeName, ModeLock * > 
def_mode_locks

Define Documentation

#define E   extern CoreExport

Definition at line 17 of file extern.h.

#define EI   extern DllExport

Definition at line 18 of file extern.h.


Function Documentation

E const char* anope_gettext ( const char *  lang,
const char *  string 
)
E bool AtTerm (  ) 

Definition at line 218 of file init.cpp.

Referenced by Init(), Server::Sync(), and UplinkSocket::~UplinkSocket().

E bool bad_password ( User u  ) 

Note a bad password attempt for the given user. If they've used up their limit, toss them off.

Parameters:
u the User to check
Returns:
true if the user was killed, otherwise false

Definition at line 27 of file actions.cpp.

References ServerConfig::BadPassLimit, ServerConfig::BadPassTimeout, Config, Anope::CurTime, User::invalid_pw_count, User::invalid_pw_time, User::Kill(), and ServerConfig::ServerName.

Referenced by CommandOSLogin::Execute(), NSReleaseRequest::OnFail(), NSRecoverRequest::OnFail(), NSIdentifyRequest::OnFail(), NSGroupRequest::OnFail(), and NSGhostRequest::OnFail().

E std::list<Anope::string> BuildStringList ( const Anope::string src,
char  delim 
)

Build a string list from a source string

Parameters:
src The source string
Returns:
a list of strings

Definition at line 548 of file misc.cpp.

References sepstream::GetToken().

Referenced by DoLogs().

E std::vector<Anope::string> BuildStringVector ( const Anope::string ,
char  = ' ' 
)
E void common_unban ( const ChannelInfo ci,
User u,
bool  full 
)

Unban the user from a channel

Parameters:
ci channel info for the channel
u The user to unban
full True to match against the users real host and IP
Returns:
void

Definition at line 55 of file actions.cpp.

References ChannelInfo::c, CMODE_BAN, Entry::GetMask(), Channel::GetModeList(), Channel::HasMode(), Entry::Matches(), and Channel::RemoveMode().

Referenced by CommandCSUnban::Execute().

E Anope::string do_strftime ( const time_t &  t,
const NickCore nc = NULL,
bool  short_output = false 
)
E time_t dotime ( const Anope::string s  ) 

dotime: Return the number of seconds corresponding to the given time string. If the given string does not represent a valid time, return -1.

A time string is either a plain integer (representing a number of seconds), or an integer followed by one of these characters: "s" (seconds), "m" (minutes), "h" (hours), or "d" (days).

Parameters:
s String to convert
Returns:
time_t

Definition at line 263 of file misc.cpp.

References Anope::string::empty().

Referenced by CommandOSException::DoAdd(), CommandOSIgnore::DoAdd(), CommandOSAKill::DoAdd(), CommandOSForbid::Execute(), CommandOSConfig::Execute(), CommandOSChanKill::Execute(), CommandNSSuspend::Execute(), CommandCSTBan::Execute(), CommandCSSuspend::Execute(), CommandOSSeen::Execute(), CommandOSSQLine::OnAdd(), CommandOSSNLine::OnAdd(), ModuleProxyScan::OnReload(), ModuleDNSBL::OnReload(), ModuleDNS::OnReload(), OSDefcon::OnReload(), CSSeen::OnReload(), ServerConfig::Read(), ValidateBotServ(), ValidateEmailReg(), ValidateLimitSessions(), and ValidateNotZero().

E Anope::string duration ( const time_t &  t,
const NickCore nc 
)

Expresses in a string the period of time represented by a given amount of seconds (with days/hours/minutes).

Parameters:
seconds time in seconds
Returns:
buffer

Definition at line 308 of file misc.cpp.

References _, stringify(), and translate().

Referenced by do_strftime(), CommandOSAKill::DoAdd(), CommandOSStats::DoStatsUptime(), CommandNSRegister::Execute(), CommandCSTBan::Execute(), CommandSeen::Execute(), CommandOSSQLine::OnAdd(), CommandOSSNLine::OnAdd(), CommandNSRelease::OnHelp(), CommandNSRecover::OnHelp(), NickServCore::OnNickIdentify(), NSRecoverRequest::OnSuccess(), and MyNickServService::Validate().

E bool enc_decrypt ( const Anope::string src,
Anope::string dest 
)

Decrypt the encrypted string src into dest

Parameters:
src The encrypted string
desc The destination string
Returns:
true on success

Definition at line 33 of file encrypt.cpp.

References Anope::string::begin(), EVENT_ALLOW, Anope::string::find(), FOREACH_RESULT, hashm, I_OnDecrypt, and Anope::string::npos.

Referenced by CommandNSSetPassword::Execute(), CommandNSSendPass::Execute(), CommandNSSASetPassword::Execute(), CommandNSRegister::Execute(), CommandNSGetPass::Execute(), NSGetPass::NSGetPass(), and NSSendPass::NSSendPass().

E void enc_encrypt ( const Anope::string src,
Anope::string dest 
)
E Anope::string expire_left ( const NickCore nc,
time_t  expires 
)

Generates a human readable string of type "expires in ..."

Parameters:
na Nick Alias
seconds time in seconds
Returns:
buffer

Definition at line 363 of file misc.cpp.

References _, Anope::CurTime, NO_EXPIRE, and translate().

Referenced by WebCPanel::OperServ::Akill::OnRequest(), CommandOSSXLineBase::ProcessList(), and CommandOSAKill::ProcessList().

E void Fork (  ) 

Definition at line 223 of file init.cpp.

Referenced by Server::Sync().

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

Check if an argument was given on startup

Parameters:
name The argument name
shortname A shorter name, eg --debug and -d
Returns:
true if name/shortname was found, false if not

Definition at line 104 of file init.cpp.

References GetCommandLineArgument().

Referenced by GetCommandLineArgument(), and Init().

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

Check if an argument was given on startup and its parameter

Parameters:
name The argument name
shortname A shorter name, eg --debug and -d
param A string to put the param, if any, of the argument
Returns:
true if name/shortname was found, false if not

Definition at line 116 of file init.cpp.

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

E void Init ( int  ac,
char **  av 
)
E void InitLanguages (  ) 
E void introduce_user ( const Anope::string user  ) 
E bool IsFile ( const Anope::string filename  ) 

Check if a file exists

Parameters:
filename The file
Returns:
true if the file exists, false if it doens't

Definition at line 46 of file misc.cpp.

References Anope::string::c_str().

Referenced by DBPlain::BackupDatabase(), DBFlatFile::BackupDatabase(), InitLanguages(), Module::Module(), DBFlatFile::OnSaveDatabase(), LogInfo::ProcessMessage(), ServerConfig::ServerConfig(), and SSLModule::SSLModule().

E bool IsValidHost ( const Anope::string host  ) 
E bool IsValidIdent ( const Anope::string ident  ) 

Checks if a username is valid

Parameters:
ident The username
Returns:
true if the ident is valid

Definition at line 405 of file misc.cpp.

References Config, Anope::string::empty(), Anope::string::length(), and ServerConfig::UserLen.

Referenced by CommandHSSetAll::Execute(), and CommandHSSet::Execute().

E int myNumToken ( const Anope::string str,
char  dilim 
)

Number of tokens in a string

Parameters:
str String
dilim Dilimiter
Returns:
number of tokens

Definition at line 531 of file misc.cpp.

References Anope::string::empty(), and Anope::string::length().

Referenced by IRCDMessageBMask::Run().

E Anope::string myStrGetToken ( const Anope::string str,
char  dilim,
int  token_number 
)

Get the token

Parameters:
str String to search in
dilim Character to search for
token_number the token number
Returns:
token

Definition at line 456 of file misc.cpp.

References Anope::string::empty(), Anope::string::find(), sepstream::GetToken(), Anope::string::npos, and sepstream::StreamEnd().

Referenced by CommandNSList::Execute(), CommandHelp::Execute(), CommandCSList::Execute(), IRCDMessageServer::Run(), IRCDMessageTBurst::Run(), and IRCDMessageBMask::Run().

E Anope::string myStrGetTokenRemainder ( const Anope::string str,
const char  dilim,
int  token_number 
)

Get the Remaining tokens

Parameters:
str String to search in
dilim Character to search for
token_number the token number
Returns:
token

Definition at line 478 of file misc.cpp.

References Anope::string::empty(), Anope::string::find(), sepstream::GetRemaining(), sepstream::GetToken(), Anope::string::npos, and sepstream::StreamEnd().

Referenced by CommandCSList::Execute(), and IRCDMessageServer::Run().

E bool nickIsServices ( const Anope::string tempnick,
bool  bot 
)

Is the given nick a network service

Parameters:
nick to check
int Check if botserv bots
Returns:
int

Definition at line 501 of file misc.cpp.

References BI_CORE, Config, Anope::string::empty(), Anope::string::equals_ci(), Anope::string::find(), findbot(), Flags< T, Size >::HasFlag(), Anope::string::npos, ServerConfig::ServerName, and Anope::string::substr().

Referenced by CommandBSBot::DoChange(), CommandBSBot::DoDel(), and CommandNSInfo::Execute().

E Anope::string normalizeBuffer ( const Anope::string buf  ) 

Normalize buffer stripping control characters and colors

Parameters:
A string to be parsed for control and color codes
Returns:
A string stripped of control and color codes

Definition at line 835 of file misc.cpp.

References Anope::string::length().

Referenced by BSKick::OnPrivmsg(), and IRCDProto::SendCTCPInternal().

E void process ( const Anope::string buffer  ) 
E void save_databases (  ) 
E void SetDefaultMLock ( ServerConfig config  ) 
E void sighandler ( int  signum  ) 
E bool str_is_pure_wildcard ( const Anope::string str  ) 

Check if the given string is a pure wildcard

Parameters:
str String to check
Returns:
1 for pure wildcard, 0 for anything else

Definition at line 713 of file misc.cpp.

References Anope::string::find_first_not_of(), and Anope::string::npos.

Referenced by Entry::Entry().

E bool str_is_wildcard ( const Anope::string str  ) 

Check if the given string is some sort of wildcard

Parameters:
str String to check
Returns:
1 for wildcard, 0 for anything else

Definition at line 703 of file misc.cpp.

References Anope::string::find_first_of(), and Anope::string::npos.

Referenced by CommandCSMode::DoSet(), and Entry::Entry().

E const char* translate ( const char *  string  ) 
E const char* translate ( const NickCore nc,
const char *  string 
)
E const char* translate ( User u,
const char *  string 
)

Definition at line 61 of file language.cpp.

References User::Account(), and translate().


Variable Documentation

Definition at line 33 of file extern.h.

Referenced by ConfigurationFile::Open().

E int debug

Definition at line 101 of file extern.h.

Referenced by CommandCSRegister::Execute(), and SetDefaultMLock().

E std::vector<Anope::string> domains

Definition at line 45 of file extern.h.

Referenced by Module::Module(), and Module::~Module().

E unsigned GenericChannelModes

Definition at line 100 of file extern.h.

Referenced by ModeManager::AddChannelMode().

E unsigned GenericUserModes

Definition at line 100 of file extern.h.

Referenced by ModeManager::AddUserMode().

E std::vector<Anope::string> languages

Definition at line 33 of file extern.h.

Referenced by Init(), InitLanguages(), and Module::Module().

Definition at line 33 of file extern.h.

Referenced by CreateLogName(), CommandOSLogSearch::CreateLogName(), and Init().

Definition at line 33 of file extern.h.

Referenced by Init(), and moduleCopyFile().

E bool noexpire
E bool nofork

Definition at line 58 of file extern.h.

Referenced by Init(), Server::Sync(), and Log::~Log().

E bool nothird

Definition at line 59 of file extern.h.

Referenced by Init(), and Module::Module().

E bool protocoldebug

Definition at line 61 of file extern.h.

Referenced by Init(), and process().

E bool quitting
E bool readonly
E bool restarting

Definition at line 65 of file extern.h.

Referenced by CommandOSRestart::Execute(), and main().

E int return_code

Definition at line 64 of file extern.h.

Referenced by Init(), main(), parent_signal_handler(), and UplinkSocket::~UplinkSocket().

Definition at line 55 of file extern.h.

Referenced by Init().

Definition at line 54 of file extern.h.

Referenced by Init().

E time_t start_time