diff options
author | Adam <Adam@anope.org> | 2011-04-23 02:24:56 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-05-16 04:06:22 -0400 |
commit | 13aa58ce5db50083c751648f87df31b3db8dc82f (patch) | |
tree | 18ae81adf4bc5206b6d128de7281e549c39d20d0 /src/config.cpp | |
parent | c8c23158a4ff74822d6c7d201dc53d879e3d91e8 (diff) |
Removed DT_CHARPTR from the config reader, its unneeded
Diffstat (limited to 'src/config.cpp')
-rw-r--r-- | src/config.cpp | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/src/config.cpp b/src/config.cpp index 293f3947f..dce6594b6 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -969,10 +969,6 @@ ConfigItems::ConfigItems(ServerConfig *conf) * unsigned blarg; * {"tag", "value", "0", new ValueContainerUInt(&conf->blarg), DT_UINTEGER, <validation>}, * - * If you want to create a directive using a character pointer without additional validation (see below for hostnames, fields with no spaces, and IP addresses): - * char *blarg; - * {"tag", "value", "", new ValueContainerChar(&conf->blarg), DT_CHARPTR, <validation>}, - * * If you want to create a directive using a string: * Anope::string blarg; * {"tag", "value", "", new ValueContainerString(&conf->blarg), DT_STRING, <validation>}, @@ -1000,7 +996,7 @@ ConfigItems::ConfigItems(ServerConfig *conf) * For the second-to-last argument, you can or (|) in the following values: * DT_NORELOAD - The variable can't be changed on a reload of the configuration * DT_ALLOW_WILD - Allows wildcards/CIDR in DT_IPADDRESS - * DT_ALLOW_NEWLINE - Allows new line characters in DT_CHARPTR, DT_STRING, and DT_CISTRING + * DT_ALLOW_NEWLINE - Allows new line characters in DT_STRING * * We may need to add some other validation functions to handle certain things, we can handle that later. * Any questions about these, w00t, feel free to ask. */ @@ -1103,7 +1099,7 @@ ConfigItems::ConfigItems(ServerConfig *conf) {"chanserv", "opersonly", "no", new ValueContainerBool(&conf->CSOpersOnly), DT_BOOLEAN, ValidateChanServ}, {"memoserv", "nick", "", new ValueContainerString(&conf->s_MemoServ), DT_STRING | DT_NORELOAD, NoValidation}, {"memoserv", "description", "Memo Service", new ValueContainerString(&conf->desc_MemoServ), DT_STRING | DT_NORELOAD, ValidateMemoServ}, - {"memoserv", "modules", "", new ValueContainerString(&Config->MemoCoreModules), DT_STRING, NoValidation}, + {"memoserv", "modules", "", new ValueContainerString(&conf->MemoCoreModules), DT_STRING, NoValidation}, {"memoserv", "maxmemos", "0", new ValueContainerUInt(&conf->MSMaxMemos), DT_UINTEGER, NoValidation}, {"memoserv", "senddelay", "0", new ValueContainerTime(&conf->MSSendDelay), DT_TIME, NoValidation}, {"memoserv", "notifyall", "no", new ValueContainerBool(&conf->MSNotifyAll), DT_BOOLEAN, NoValidation}, @@ -1163,7 +1159,7 @@ ConfigItems::ConfigItems(ServerConfig *conf) {"include", {"type", "name", ""}, {"", "", ""}, - {DT_CHARPTR, DT_CHARPTR}, + {DT_STRING, DT_STRING}, InitInclude, DoInclude, DoneInclude}, {"uplink", {"host", "ipv6", "port", "password", ""}, @@ -1173,7 +1169,7 @@ ConfigItems::ConfigItems(ServerConfig *conf) {"module", {"name", ""}, {"", ""}, - {DT_CHARPTR}, + {DT_STRING}, InitModules, DoModule, DoneModules}, {"log", {"target", "source", "logage", "inhabitlogchannel", "admin", "override", "commands", "servers", "channels", "users", "other", "rawio", "debug", ""}, @@ -1183,12 +1179,12 @@ ConfigItems::ConfigItems(ServerConfig *conf) {"opertype", {"name", "inherits", "commands", "privs", ""}, {"", "", "", "", ""}, - {DT_CHARPTR, DT_CHARPTR, DT_CHARPTR, DT_CHARPTR}, + {DT_STRING, DT_STRING, DT_STRING, DT_STRING}, InitOperTypes, DoOperType, DoneOperTypes}, {"oper", {"name", "type", "password", "certfp", ""}, {"", "", "", "", ""}, - {DT_CHARPTR, DT_CHARPTR, DT_CHARPTR, DT_CHARPTR}, + {DT_STRING, DT_STRING, DT_STRING, DT_STRING}, InitOpers, DoOper, DoneOpers}, {"", {""}, @@ -1275,15 +1271,6 @@ void ServerConfig::Read() ValidateIP(vl[vl.size() - 1].GetValue(), configitems.MultiValues[Index].tag, configitems.MultiValues[Index].items[valuenum], allow_wild); break; } - case DT_CHARPTR: - { - Anope::string item; - if (ConfValue(hash, configitems.MultiValues[Index].tag, configitems.MultiValues[Index].items[valuenum], configitems.MultiValues[Index].items_default[valuenum], tagnum, item, allow_newlines)) - vl.push_back(ValueItem(item.c_str())); - else - vl.push_back(ValueItem("")); - break; - } case DT_STRING: { Anope::string item; @@ -1372,13 +1359,6 @@ void ServerConfig::Read() vcs->Set(vi.GetValue()); break; } - case DT_CHARPTR: - { - ValueContainerChar *vcc = debug_cast<ValueContainerChar *>(configitems.Values[Index].val); - // Make sure we also copy the null terminator - vcc->Set(vi.GetString(), strlen(vi.GetString()) + 1); - break; - } case DT_STRING: { ValueContainerString *vcs = debug_cast<ValueContainerString *>(configitems.Values[Index].val); @@ -1775,12 +1755,6 @@ ValueItem::ValueItem(bool value) : v("") v = n.str(); } -ValueItem::ValueItem(const char *value) : v(value) { } - -ValueItem::ValueItem(const std::string &value) : v(value) { } - -ValueItem::ValueItem(const ci::string &value) : v(value) { } - ValueItem::ValueItem(const Anope::string &value) : v(value) { } void ValueItem::Set(const char *value) |