aboutsummaryrefslogtreecommitdiffstats
path: root/src/helperfuncs.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Some systems with whacky va_list implementations do undefined stuff when ↵Gravatar Adam2013-05-231-3/+15
| | | | | | | | vsnprintf is called multiple times with the same list, so have InspIRCd::Format va_copy the list before each call
* | Merge pull request #545 from SaberUK/master+logging-cleanupGravatar Attila Molnar2013-05-211-23/+1
|\ \ | | | | | | Clean up the logging system (part 1 of 2).
| * | Fix spacing in calls to LogManager::Log.Gravatar Peter Powell2013-05-191-1/+1
| | |
| * | Purge a ton of code related to non <log> related logging.Gravatar Peter Powell2013-05-191-22/+0
| | | | | | | | | | | | | | | | | | | | | - InspIRCd::OpenLog - ./inspircd --logfile [file] This is no longer needed now we have (since 1.2) custom logging.
* | | Fixup last commitGravatar Adam2013-05-201-1/+1
| | |
* | | Replaced vsnprintf with VAFORMAT pretty much everywhere.Gravatar Daniel Vassdal2013-05-181-7/+3
| | |
* | | Added macro to allow simpler logic in functions with the need to vsnprintfGravatar Daniel Vassdal2013-05-181-5/+8
|/ /
* | Remove the size argument from IsChannel and IsNick.Gravatar Peter Powell2013-05-181-4/+4
| | | | | | | | | | There was only one case (which was probably an error) where these methods were not set to their ServerLimits value.
* | Added a function to replace all the ugly sprintf-ing everywhereGravatar Daniel Vassdal2013-05-161-0/+13
| |
* | Add method for writing server notices.Gravatar Peter Powell2013-05-141-2/+2
| | | | | | | | | | | | | | | | | | This allows us to send a server notice to a user without worrying about whether they are registered or not. If a user receives a server notice and they are not registered then the nickname field will contain an asterisk instead of their nick name.
* | Remove const char* versions of ↵Gravatar attilamolnar2013-04-131-39/+0
| | | | | | | | InspIRCd::FindNick()/FindNickOnly()/FindUUID()/FindChan()
* | Add LOG_ prefix to the log level enum values.Gravatar Peter Powell2013-04-121-2/+2
| |
* | Convert ISUPPORT to use a map instead of a string.Gravatar Peter Powell2013-04-111-20/+0
| |
* | Convert InspIRCd::Duration() to be staticGravatar attilamolnar2013-04-031-1/+1
| |
* | Change IsNickHandler()/IsIdentHandler()/IsChannelHandler() to use C++ ↵Gravatar attilamolnar2013-04-011-27/+14
| | | | | | | | strings as arguments instead of C strings
* | Convert IsSID() to a static member function, modules shouldn't override itGravatar attilamolnar2013-04-011-1/+1
|/
* Remove ServerLimits::Finalise(), it's completely wrongGravatar attilamolnar2012-12-091-2/+2
| | | | Truncate <limits:identmax>+1 long idents in User::ChangeIdent()
* Add a typedef for LocalUserListGravatar attilamolnar2012-11-291-1/+1
|
* Have FindUUID(const char*) call FindUUID(const std::string&), not the other ↵Gravatar attilamolnar2012-11-281-5/+5
| | | | way around
* Move ServerConfig::ProcessColors() into class InspIRCd, as a helper functionGravatar attilamolnar2012-10-291-0/+57
| | | | Change signature to accept a file_cache reference so modules can use it easily
* Fix for #268.Gravatar Peter Powell2012-10-191-0/+27
| | | | | - Move color stripping code to helperfuncs. - Strip color codes before matching filters.
* Replace printf(_c) with iostreamGravatar ChrisTX2012-10-141-2/+3
|
* Windows: In-depth cleanup (see details)Gravatar ChrisTX2012-10-121-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -Fix x64 builds for Windows. Now all configurations compile. -Remove the non-working rebase stuff. -Remove the Windows fork hack and instead use FreeConsole() to emulate the behavior. This directly allows us to compile with ASLR, which is turned on now. -Remove the old IPC mechanism for the removed GUI. This is not needed anymore as the GUI wasn't ever supported on anything newer than 1.2 -Remove the WIN32/WINDOWS macros. _WIN32 is supported on all x86-based VC++ targets, so that's what we need. -Enable optimizations for release builds. -De-duplicate printf_c(), it was previously copy-pasted into colors.h for configure -Add the VC++ specific bad files in .gitignore -Disable PID writing on Windows. This is only making sense for *nix builds. -Replace the CPU usage retrieval with an algorithm analogous to the *nix behavior. Also supports separated now/total values. (Tested with a dummy busy loop - seems working) -Removed certain unused functions and variables -Remove stdint defines from the windows wrapper -Remove CRT debug alloc. This is a bad idea as it would define a macro to replace free which breaks builds. -Re-evaluated the warnings list, commented it. -Moved inspircd_config/_version to include/ to match *nix -Removed the creation of inspircd_se_config, as it isn't used at all. -Made non-git builds show as "r0" instead of "r" (thanks to @SaberUK for pointing this out) -Fixed up m_spanningtree's project paths. Now all configurations (debug/release x86/x64) have been tested and build properly. -Moved FindDNS out of the wrapper and matched its log behavior with *nix. (It's pointless having it in the wrapper after the recent slimming down) -Replaced random/srandom wrappers with a mechanism that tries to use Windows' Random API first is no SSL module is loaded. -Removed more old junk from support for compilers older than VC++ 2010 (we don't have project files for these, so compiling them would be hard anyways) -Removed the unused ClearConsole() -Removed unused includes from the wrapper. Also, do not include psapi.h here if we don't link psapi.lib. This should be done where appropriate. -Made inet_aton an inline function for increased performance -C4800, performance warning about bool forcing, resolved at all occurrences. -C4701, uninitialized variable 'cached', resolved at all occurrences. -dlerror() was migrated out of the wrapper for more thread safety (no global buffer being shared) and increased performance. -Removed the wrong CRT debug flags. This drains a lot of performance. -Removed the clock_gettime/gettimeofday wrappers -Replaced all TCHAR/ANSI mix-ups of functions with the correct respective function. -Added a block of C4355 for < VS2012 -Update project files for c870714
* Replace hardcoded paths with configurable onesGravatar ChrisTX2012-10-041-1/+1
| | | | | | | | | | This patchset aims to ease the packaging of InspIRCd for a system-wide installation scenario. Changes in detail: configure: Add the options --log-path and --data-path m_ssl_gnutls, openssl: Change the hardcoded "conf/" to the existent CONFIG_PATH macro m_xline_db: Make the location of xline.db configurable. It will use --data-path as default value, but this can be changed using the configuration files.
* Replace copyright headers with headers granting specific authors copyrightGravatar Robby-2012-04-191-8/+19
|
* Cap masks and bans at 250 charactersGravatar danieldg2010-03-011-0/+3
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12575 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix compilation warningGravatar danieldg2010-02-201-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12504 e03df62e-2008-0410-955e-edbf42e46eb7
* Restore <options:exemptchanops> with long namesGravatar danieldg2010-02-201-0/+25
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12502 e03df62e-2008-0410-955e-edbf42e46eb7
* Add random number generation functions to InspIRCd class.Gravatar danieldg2010-02-091-0/+28
| | | | | | | Default implementation uses libc random(), which can be better than rand(). If gnutls is loaded, gcrypt will be used to provide random numbers. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12404 e03df62e-2008-0410-955e-edbf42e46eb7
* Sort items in the 005 lineGravatar danieldg2010-02-021-3/+8
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12351 e03df62e-2008-0410-955e-edbf42e46eb7
* ...because every now and again, i have to do a massive commit.Gravatar brain2010-01-111-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12248 e03df62e-2008-0410-955e-edbf42e46eb7
* Move command-line items to CommandLineConfGravatar danieldg2009-10-211-24/+7
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11949 e03df62e-2008-0410-955e-edbf42e46eb7
* Split LocalUser and RemoteUserGravatar danieldg2009-10-211-1/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11940 e03df62e-2008-0410-955e-edbf42e46eb7
* Change to new execution directory structureGravatar danieldg2009-10-131-15/+1
| | | | | | | | Don't change CWD into bin/ Remove path-resolution hacks from configuration Store pidfile and xline DBs in data, logs in logs. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11866 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix valgrind issues and crashes on exitGravatar danieldg2009-10-021-9/+8
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11794 e03df62e-2008-0410-955e-edbf42e46eb7
* Remove InspIRCd* parameters and fieldsGravatar danieldg2009-09-261-5/+5
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11763 e03df62e-2008-0410-955e-edbf42e46eb7
* Create StreamSocket for IO hooking implementationGravatar danieldg2009-09-211-8/+4
| | | | | | | | | | | | | | Fixes the SSL SendQ bug Removes duplicate code between User and BufferedSocket Simplify SSL module API Simplify EventHandler API (Readable/Writeable moved to SE) Add hook for culled objects to invoke callbacks prior to destructor Replace SocketCull with GlobalCull now that sockets can close themselves Shorten common case of user read/parse/write path: User::Write is now zero-copy up to syscall/SSL invocation User::Read has only two copy/scan passes from read() to ProcessCommand git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11752 e03df62e-2008-0410-955e-edbf42e46eb7
* ModResult conversion: Change return type of all module functionsGravatar danieldg2009-09-021-2/+2
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11634 e03df62e-2008-0410-955e-edbf42e46eb7
* Cast rework: use C++ style static_cast<> instead of C-style castsGravatar danieldg2009-09-021-2/+2
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11595 e03df62e-2008-0410-955e-edbf42e46eb7
* Fixes for config readerGravatar danieldg2009-08-121-10/+0
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11504 e03df62e-2008-0410-955e-edbf42e46eb7
* Update all wiki links to point to the new wiki. This was done automatically ↵Gravatar psychon2009-03-151-1/+1
| | | | | | | | | with the following command, only .Makefile.inc got some indent fixups by hand. for file in $(find -type f -and -not -path '*/.svn/*' -and -not -name '*.so') ; do sed -e 's#http://www.inspircd.org/wiki#http://wiki.inspircd.org#' -e 's#http://wiki.inspircd.org/index.php/#http://wiki.inspircd.org/#' -i $file ; done git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11223 e03df62e-2008-0410-955e-edbf42e46eb7
* Nuke trailing spacesGravatar peavey2009-02-141-7/+4
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11105 e03df62e-2008-0410-955e-edbf42e46eb7
* Fix m_nationalchars using a copy and paste of my unsafe copy and paste ↵Gravatar brain2009-01-231-0/+3
| | | | | | | | | algorithm, that will lock up if the string to replace contains the string to search for. Finally make this function a core utility function and remove the copies from 3 modules m_alias m_nationalchars and m_sqlauth git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10990 e03df62e-2008-0410-955e-edbf42e46eb7
* Update copyrights for 2009.Gravatar w00t2009-01-021-2/+2
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10932 e03df62e-2008-0410-955e-edbf42e46eb7
* Make this less confusing for us and usersGravatar w00t2008-10-281-31/+1
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10746 e03df62e-2008-0410-955e-edbf42e46eb7
* match() is no longer a function+no header, now a static method of InspIRCd ↵Gravatar w00t2008-08-211-1/+0
| | | | | | class, blah blah blah. Also rip out the 1.2 matcher, as it was slow, and replace it with one adapted from znc, which happens to be a tiny bit faster than 1.1's (and the fastest I've seen so far that works properly) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10212 e03df62e-2008-0410-955e-edbf42e46eb7
* Change extban seperator in 005 to match charybdis and unrealGravatar w00t2008-08-061-2/+2
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10107 e03df62e-2008-0410-955e-edbf42e46eb7
* Remove last vestige of libircdfoo, by changing tag into a single ↵Gravatar w00t2008-07-291-1/+1
| | | | | | identifier marking object as requiring compilation into a .o (minor commit) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10076 e03df62e-2008-0410-955e-edbf42e46eb7
* Applied patch by psychon to make AddExtBanChar correctly take a single charGravatar special2008-07-161-4/+5
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10024 e03df62e-2008-0410-955e-edbf42e46eb7
* Add InspIRCd::AddExtBanChar() to avoid copypasta.Gravatar w00t2008-07-141-0/+13
| | | | git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10017 e03df62e-2008-0410-955e-edbf42e46eb7