95 Commits

Author SHA1 Message Date
brain
96495c2009 Fix a major whoopsie in that class i just added. It must be derived using virtual methods, because each TYPE of bitmask must have its own static allocation of flags. See the (long winded) comments.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5762 e03df62e-2008-0410-955e-edbf42e46eb7
2006-11-18 01:03:47 +00:00
brain
77300844a4 Reduce size of max number of bytes in a bitfield from a 4 or 8 byte field to a 1 byte field (unsigned char).
This still allows storage of 8*255 bits, which is MORE than enough (for the interested, its 2040 bits)


git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5761 e03df62e-2008-0410-955e-edbf42e46eb7
2006-11-18 00:32:35 +00:00
brain
8827eca1da Properly document irc::dynamicbitmask
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5760 e03df62e-2008-0410-955e-edbf42e46eb7
2006-11-18 00:08:46 +00:00
brain
bc8ba059b9 Fix this so it works, passes test case. Provide a method to query for a bit and to return the total size in bytes of the bitset
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5758 e03df62e-2008-0410-955e-edbf42e46eb7
2006-11-17 23:51:35 +00:00
brain
11f7397023 Add irc::dynamicbitmask class. Feel free to take a look and offer suggestions, as far as i can tell its about as efficient as im going to make it.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5757 e03df62e-2008-0410-955e-edbf42e46eb7
2006-11-17 23:23:32 +00:00
brain
a9b538041a Allow checking of overlapped ports. A bit of sensible thought prevents this from being O(n^2)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5694 e03df62e-2008-0410-955e-edbf42e46eb7
2006-11-11 15:46:00 +00:00
brain
c9029f8db2 Document irc::portparser with comments :-)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5693 e03df62e-2008-0410-955e-edbf42e46eb7
2006-11-11 15:28:18 +00:00
brain
69c3a32784 Add irc::portparser, a class to parse port ranges in the form "6660,6661,6662-6669,7000".
Needs testing, watch next few commits.


git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5690 e03df62e-2008-0410-955e-edbf42e46eb7
2006-11-11 15:17:40 +00:00
brain
364735e18b Document a ton of classes (e.g. give them a short description for http://svn.inspircd.org/docs/annotated.html)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5434 e03df62e-2008-0410-955e-edbf42e46eb7
2006-10-06 14:23:37 +00:00
brain
e25e200024 Document
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5404 e03df62e-2008-0410-955e-edbf42e46eb7
2006-10-03 13:57:53 +00:00
brain
9716d24be9 New helper class irc::stringjoiner - it pwns you.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5403 e03df62e-2008-0410-955e-edbf42e46eb7
2006-10-03 13:46:28 +00:00
brain
cf72e0d472 Remove testcases
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5398 e03df62e-2008-0410-955e-edbf42e46eb7
2006-10-02 13:48:00 +00:00
brain
f0e0cb4da6 mmmm dinner break, oh and document and make use of modestacker.
Someone test this, i cant as im at work.


git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5395 e03df62e-2008-0410-955e-edbf42e46eb7
2006-10-02 12:59:55 +00:00
brain
4ae42b33e6 Add more features to modestacker so that we can stack +, -, and parameterless modes
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5391 e03df62e-2008-0410-955e-edbf42e46eb7
2006-10-02 09:24:49 +00:00
brain
bd0413a193 More efficient modestacker
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5390 e03df62e-2008-0410-955e-edbf42e46eb7
2006-10-02 08:51:45 +00:00
brain
02fe4a3085 modestacker class, stacks modes and returns a string list of up to MAXMODES modes
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5389 e03df62e-2008-0410-955e-edbf42e46eb7
2006-10-02 08:47:14 +00:00
brain
0e21e5b642 Turn irc::commasepstream into a base class, irc::sepstream, inherit two classes from it: irc::commasepstream and irc::spacesepstream, to be used for the most common token seperators "," and " "
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5266 e03df62e-2008-0410-955e-edbf42e46eb7
2006-09-17 14:08:03 +00:00
brain
ba5a5b345c Move Spacify() into irc:: namespace as multiple modules use it now
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5200 e03df62e-2008-0410-955e-edbf42e46eb7
2006-09-10 17:03:50 +00:00
brain
d4af574074 We now have a test module that can dump someones certificate information: /sslinfo <nick>
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5125 e03df62e-2008-0410-955e-edbf42e46eb7
2006-09-03 18:57:16 +00:00
brain
05066cfa55 Comments
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4952 e03df62e-2008-0410-955e-edbf42e46eb7
2006-08-18 16:10:50 +00:00
brain
d546725cb6 Move lowermap[] into a pre-initialised const array in hashcomp.h,
get rid of InspIRCd::MakeLowertab()


git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4951 e03df62e-2008-0410-955e-edbf42e46eb7
2006-08-18 15:59:23 +00:00
brain
cba65964eb Document the nspace namespace
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4906 e03df62e-2008-0410-955e-edbf42e46eb7
2006-08-12 01:17:23 +00:00
brain
318552487d Move strlower into nspace namespace where hash<std::string> lives
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4850 e03df62e-2008-0410-955e-edbf42e46eb7
2006-08-10 18:54:29 +00:00
brain
d7336f351d Move the socket functions like insp_ntoa into their own namespace. They arent really sensible to put into a class, but namespacing them out discourages developers from directly using them without explicitly saing 'using irc::sockets::BindPorts' or whatever first. Some functions such as insp_ntoa are already 'exposed' by headers that use them so 'using irc::sockets::inet_ntoa' isnt required.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4828 e03df62e-2008-0410-955e-edbf42e46eb7
2006-08-10 00:36:07 +00:00
brain
c80508b28b Move to entirely using insp_sockaddr and insp_inaddr for socket stuff, first step on the road to ipv6 support
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4609 e03df62e-2008-0410-955e-edbf42e46eb7
2006-08-01 10:37:16 +00:00
brain
b5788187ac Document irc::commasepstream and irc::tokenstream
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4414 e03df62e-2008-0410-955e-edbf42e46eb7
2006-07-16 15:31:53 +00:00
brain
085cd4278f Created new class irc::commasepstream.
Will read comma seperated lists and works identically to irc::tokenstream
It's re-entrant so we can run two of them together for JOIN


git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4412 e03df62e-2008-0410-955e-edbf42e46eb7
2006-07-16 15:08:59 +00:00
om
c195e03e61 const the std::string reference in tokenstream's constructor
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4400 e03df62e-2008-0410-955e-edbf42e46eb7
2006-07-16 07:23:03 +00:00
brain
ef10f984fa This should be faster, we read it like a stream now with GetToken until GetToken returns "".
The optimizations done by gcc means theres only one std::string constructor call per token, which is mmm yum.


git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4397 e03df62e-2008-0410-955e-edbf42e46eb7
2006-07-16 02:09:58 +00:00
brain
6ab0b94dce irc::tokenstream is a token parser which using std::string and std::vector builds a list of tokens using irc parsing rules.
e.g.:
:arse PRIVMSG #chan :foo bar baz
becomes
a[0] = ":arse", a[1] = "PRIVMSG", a[2] = "#chan", a[3] = "foo bar baz".

*** SOMEONE *** needs to optimize this or at least verify its neatness (without making it total craq and unreadable). Feel free to mess with my code.
Any optimizations you make, run them against the COMMENTED OUT TEST SUITE at the top of main() in src/inspircd.cpp and ensure ALL output is the same
with no crashes. (note: if you comment out and build with the test suite, all inspircd will do is output test data and exit!)


git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4396 e03df62e-2008-0410-955e-edbf42e46eb7
2006-07-16 01:40:58 +00:00
brain
40ef7ec1b6 3.3 -> 3.4 fix (the 3.3 stuff was actually craq)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4393 e03df62e-2008-0410-955e-edbf42e46eb7
2006-07-14 21:29:23 +00:00
om
9063972162 Routing more socket includes through socket.h
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3868 e03df62e-2008-0410-955e-edbf42e46eb7
2006-04-10 22:16:34 +00:00
brain
bb7ff3b7b6 AIEEE fucking overloaded operators
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3263 e03df62e-2008-0410-955e-edbf42e46eb7
2006-02-19 23:21:41 +00:00
brain
8942c3cd32 Tweaks
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3261 e03df62e-2008-0410-955e-edbf42e46eb7
2006-02-19 23:17:17 +00:00
brain
f0610a1fa2 Added + and == operators between std::string and irc::string.
Its too late at night to wrestle with the = operator, this can wait for another time.


git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3260 e03df62e-2008-0410-955e-edbf42e46eb7
2006-02-19 23:14:37 +00:00
om
ca549070d9 Add operators >> and << for irc::string and i/ostreams. m_cban utilises this
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3066 e03df62e-2008-0410-955e-edbf42e46eb7
2006-02-03 22:40:10 +00:00
brain
1383dba43e Updated copyrights in headers etc using perl inplace edit
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2795 e03df62e-2008-0410-955e-edbf42e46eb7
2006-01-15 15:59:11 +00:00
brain
d5fed3976b Updated to keep lowermap const within hashcomp.cpp
Updated docs


git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1401 e03df62e-2008-0410-955e-edbf42e46eb7
2005-05-15 19:33:39 +00:00
brain
7631775095 Updated strhashcomp to use irc::string internally rather than a combination of strlower and strcasecmp
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1400 e03df62e-2008-0410-955e-edbf42e46eb7
2005-05-15 19:27:38 +00:00
brain
636f32fcd0 Moved StrHashComp and InAddr_HashComp into the irc:: namespace
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1398 e03df62e-2008-0410-955e-edbf42e46eb7
2005-05-15 18:35:39 +00:00
brain
a48ee868ed Added comments for doxygen
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1395 e03df62e-2008-0410-955e-edbf42e46eb7
2005-05-15 17:01:47 +00:00
brain
a79130a1e1 Added irc::string
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1394 e03df62e-2008-0410-955e-edbf42e46eb7
2005-05-15 16:44:44 +00:00
brain
c4a230243f sorted hashcomp etc
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1387 e03df62e-2008-0410-955e-edbf42e46eb7
2005-05-15 04:21:31 +00:00
brain
eb7125445e (Untested) added hashcomp.cpp, seperates out the stl hash_map stuff
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1384 e03df62e-2008-0410-955e-edbf42e46eb7
2005-05-15 03:17:33 +00:00
brain
eb4229deed Moved a ton of functions into helperfuncs.h to speed up recompiles
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1383 e03df62e-2008-0410-955e-edbf42e46eb7
2005-05-15 03:03:23 +00:00