X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=include%2Finspircd.h;h=b16df9d71dae41964b4ed5b3722a1708a35a1a0c;hb=63601e946e77f11835cf9cbb87c55fe41e0b12bb;hp=4850d5a0347febb02c17e0b83c05d5b6adb47bdd;hpb=3a921efb0bd049eb8cccfcc205ebb260c78b423a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/inspircd.h b/include/inspircd.h index 4850d5a03..b16df9d71 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -346,7 +346,7 @@ class CoreExport InspIRCd /** Mode handler, handles mode setting and removal */ - ModeParser* Modes; + ModeParser Modes; /** Command parser, handles client to server commands */ @@ -362,12 +362,12 @@ class CoreExport InspIRCd /** LogManager handles logging. */ - LogManager *Logs; + LogManager Logs; /** ModuleManager contains everything related to loading/unloading * modules. */ - ModuleManager* Modules; + ModuleManager Modules; /** BanCacheManager is used to speed up checking of restrictions on connection * to the IRCd. @@ -385,7 +385,7 @@ class CoreExport InspIRCd /** Snomask manager - handles routing of snomask messages * to opers. */ - SnomaskManager* SNO; + SnomaskManager SNO; /** Timer manager class, triggers Timer timer events */ @@ -397,7 +397,7 @@ class CoreExport InspIRCd /** User manager. Various methods and data associated with users. */ - UserManager *Users; + UserManager Users; /** Channel list, a hash_map containing all channels XXX move to channel manager class */ @@ -662,8 +662,21 @@ class CoreExport InspIRCd void Cleanup(); /** Return a time_t as a human-readable string. + * @param format The format to retrieve the date/time in. See `man 3 strftime` + * for more information. If NULL, "%a %b %d %T %Y" is assumed. + * @param utc True to convert the time to string as-is, false to convert it to local time first. + * @return A string representing the given date/time. */ - static std::string TimeString(time_t curtime); + static std::string TimeString(time_t curtime, const char* format = NULL, bool utc = false); + + /** Compare two strings in a timing-safe way. If the lengths of the strings differ, the function + * returns false immediately (leaking information about the length), otherwise it compares each + * character and only returns after all characters have been compared. + * @param one First string + * @param two Second string + * @return True if the strings match, false if they don't + */ + static bool TimingSafeCompare(const std::string& one, const std::string& two); /** Begin execution of the server. * NOTE: this function NEVER returns. Internally,