diff options
author | Adam <Adam@anope.org> | 2012-12-13 06:12:56 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-12-13 06:12:56 -0500 |
commit | c1077faa281c5635f85b892e605e23bd6c8fcc3b (patch) | |
tree | 213b5f87a19f182e1efd6110f03ff10d5b10ebf6 /include/anope.h | |
parent | 76ba147c22944b67e8522cd2bb7b6e1bae498ced (diff) |
Optimize much of the database code and serialize code.
Diffstat (limited to 'include/anope.h')
-rw-r--r-- | include/anope.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/anope.h b/include/anope.h index 30ca48e69..c241524ab 100644 --- a/include/anope.h +++ b/include/anope.h @@ -13,6 +13,8 @@ #ifndef ANOPE_H #define ANOPE_H +#include <signal.h> + #include "hashcomp.h" namespace Anope @@ -282,9 +284,12 @@ namespace Anope * Stream insertion operator, must be friend because they cannot be inside the class. */ friend std::ostream &operator<<(std::ostream &os, const string &_str); + friend std::istream &operator>>(std::istream &is, string &_str); }; inline std::ostream &operator<<(std::ostream &os, const string &_str) { return os << _str._string; } + /* This is not standard to make operator>> behave like operator<< in that it will allow extracting a whole line, not just one word */ + inline std::istream &operator>>(std::istream &is, string &_str) { return std::getline(is, _str._string); } inline const string operator+(char chr, const string &str) { string tmp(chr); tmp += str; return tmp; } inline const string operator+(const char *_str, const string &str) { string tmp(_str); tmp += str; return tmp; } @@ -318,6 +323,8 @@ namespace Anope /** The value to return from main() */ extern int ReturnValue; + + extern sig_atomic_t Signal; extern bool Quitting; extern bool Restarting; extern Anope::string QuitReason; @@ -376,6 +383,10 @@ namespace Anope */ extern void Fork(); + /** Does something with the signal in Anope::Signal + */ + extern void HandleSignal(); + /** One of the first functions called, does general initialization such as reading * command line args, loading the configuration, doing the initial fork() if necessary, * initializating language support, loading modules, and loading databases. |