summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-13 12:32:37 +0000
committerRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-10-13 12:32:37 +0000
commit2b0e9c3f5f0eb631619bc111764146553bcdf303 (patch)
treedc85f649a57bf72fc300808b36bee606daff9688 /include
parent3324e62bae6f04e4f16f113b2e3352fae242f405 (diff)
Merge commit 'cbx/anopeng-config' into anopeng-config
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1429 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include')
-rw-r--r--include/extern.h38
-rw-r--r--include/hashcomp.h82
-rw-r--r--include/services.h3
-rw-r--r--include/sysconf.h.in6
-rw-r--r--include/sysconf.h.win322
5 files changed, 99 insertions, 32 deletions
diff --git a/include/extern.h b/include/extern.h
index 7135f7229..44f489fdd 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -217,12 +217,6 @@ E char *get_mlock_modes(ChannelInfo * ci, int complete);
E int stricmp(const char *s1, const char *s2);
E int strnicmp(const char *s1, const char *s2, size_t len);
#endif
-#if !HAVE_STRDUP
-E char *strdup(const char *s);
-#endif
-#if !HAVE_STRSPN
-E size_t strspn(const char *s, const char *accept);
-#endif
#ifdef _WIN32
char *sockstrerror(int error);
#endif
@@ -324,28 +318,28 @@ E int DontQuoteAddresses;
E int NSDefFlags;
E int NSDefLanguage;
-E int NSRegDelay;
-E int NSResendDelay;
-E int NSExpire;
-E int NSRExpire;
-E int NSForceEmail;
+E time_t NSRegDelay;
+E time_t NSResendDelay;
+E time_t NSExpire;
+E time_t NSRExpire;
+E bool NSForceEmail;
E int NSMaxAliases;
E int NSAccessMax;
E char *NSEnforcerUser;
E char *NSEnforcerHost;
-E int NSReleaseTimeout;
-E int NSAllowKillImmed;
-E int NSNoGroupChange;
-E int NSListOpersOnly;
+E time_t NSReleaseTimeout;
+E bool NSAllowKillImmed;
+E bool NSNoGroupChange;
+E bool NSListOpersOnly;
E int NSListMax;
E char *NSGuestNickPrefix;
-E int NSSecureAdmins;
-E int NSStrictPrivileges;
-E int NSEmailReg;
-E int NSModeOnID;
-E int NSRestrictGetPass;
-E int NSNickTracking;
-E int NSAddAccessOnReg;
+E bool NSSecureAdmins;
+E bool NSStrictPrivileges;
+E bool NSEmailReg;
+E bool NSModeOnID;
+E bool NSRestrictGetPass;
+E bool NSNickTracking;
+E bool NSAddAccessOnReg;
E int CSDefFlags;
E int CSMaxReg;
diff --git a/include/hashcomp.h b/include/hashcomp.h
new file mode 100644
index 000000000..8d0b09ec2
--- /dev/null
+++ b/include/hashcomp.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2002-2008 InspIRCd Development Team
+ * Copyright (C) 2008 Anope Team <info@anope.org>
+ *
+ * Please read COPYING and README for further details.
+ *
+ * These classes have been copied from InspIRCd and modified
+ * for use in Anope.
+ *
+ * $Id$
+ *
+ */
+
+#ifndef _HASHCOMP_H_
+#define _HASHCOMP_H_
+
+#include <string>
+
+/** sepstream allows for splitting token seperated lists.
+ * Each successive call to sepstream::GetToken() returns
+ * the next token, until none remain, at which point the method returns
+ * an empty string.
+ */
+class sepstream
+{
+ private:
+ /** Original string.
+ */
+ std::string tokens;
+ /** Last position of a seperator token
+ */
+ std::string::iterator last_starting_position;
+ /** Current string position
+ */
+ std::string::iterator n;
+ /** Seperator value
+ */
+ char sep;
+ public:
+ /** Create a sepstream and fill it with the provided data
+ */
+ sepstream(const std::string &source, char seperator);
+ virtual ~sepstream() { }
+
+ /** Fetch the next token from the stream
+ * @param token The next token from the stream is placed here
+ * @return True if tokens still remain, false if there are none left
+ */
+ virtual bool GetToken(std::string &token);
+
+ /** Fetch the entire remaining stream, without tokenizing
+ * @return The remaining part of the stream
+ */
+ virtual const std::string GetRemaining();
+
+ /** Returns true if the end of the stream has been reached
+ * @return True if the end of the stream has been reached, otherwise false
+ */
+ virtual bool StreamEnd();
+};
+
+/** A derived form of sepstream, which seperates on commas
+ */
+class commasepstream : public sepstream
+{
+ public:
+ /** Initialize with comma seperator
+ */
+ commasepstream(const std::string &source) : sepstream(source, ',') { }
+};
+
+/** A derived form of sepstream, which seperates on spaces
+ */
+class spacesepstream : public sepstream
+{
+ public:
+ /** Initialize with space seperator
+ */
+ spacesepstream(const std::string &source) : sepstream(source, ' ') { }
+};
+
+#endif
diff --git a/include/services.h b/include/services.h
index aafbb3ddc..c8d9af8ac 100644
--- a/include/services.h
+++ b/include/services.h
@@ -266,7 +266,6 @@ struct ircdvars_ {
const char *operservmode; /* Mode used by OperServ */
const char *botservmode; /* Mode used by BotServ */
const char *helpservmode; /* Mode used by HelpServ */
- const char *devnullmode; /* Mode used by Dev/Null */
const char *globalmode; /* Mode used by Global */
const char *botserv_bot_mode; /* Mode used by BotServ Bots */
int max_symbols; /* Chan Max Symbols */
@@ -409,7 +408,7 @@ typedef struct {
/* Flags: */
#define PARAM_OPTIONAL 0x01
-#define PARAM_FULLONLY 0x02 /* Directive only allowed if !STREAMLINED */
+/*#define PARAM_FULLONLY 0x02 unused */
#define PARAM_RELOAD 0x04 /* Directive is reloadable */
/*************************************************************************/
diff --git a/include/sysconf.h.in b/include/sysconf.h.in
index f4b3f99e7..8c0f63f56 100644
--- a/include/sysconf.h.in
+++ b/include/sysconf.h.in
@@ -42,9 +42,6 @@
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
-/* Define to 1 if you have the `strdup' function. */
-#undef HAVE_STRDUP
-
/* Define to 1 if you have the `stricmp' function. */
#undef HAVE_STRICMP
@@ -60,9 +57,6 @@
/* Define to 1 if you have the `strlcpy' function. */
#undef HAVE_STRLCPY
-/* Define to 1 if you have the `strspn' function. */
-#undef HAVE_STRSPN
-
/* "" */
#undef HAVE_SYS_SELECT_H
diff --git a/include/sysconf.h.win32 b/include/sysconf.h.win32
index fb6d5a6e9..5b33a3608 100644
--- a/include/sysconf.h.win32
+++ b/include/sysconf.h.win32
@@ -18,8 +18,6 @@ typedef unsigned __int8 u_int8_t;
#define HAVE_STRICMP 1
#define HAVE_STRCASECMP 0
-#define HAVE_STRDUP 1
-#define HAVE_STRSPN 1
#define HAVE_STRSIGNAL 0
#define HAVE_GETTIMEOFDAY 0
#define HAVE_SETGRENT 0