diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-12 02:26:05 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-12 02:26:05 +0000 |
commit | a266dadd1351d10b56ec187c7b6f7af75350ed68 (patch) | |
tree | 0729c41ca0f1719c69277dc862d4704d63d6248f /docs/man/man3/ConfigReader.3 | |
parent | c42a4ace0281ee6a89f6df2af3b15563ffe98064 (diff) |
Documented new recvq and sendq stuff
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1367 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'docs/man/man3/ConfigReader.3')
-rw-r--r-- | docs/man/man3/ConfigReader.3 | 264 |
1 files changed, 132 insertions, 132 deletions
diff --git a/docs/man/man3/ConfigReader.3 b/docs/man/man3/ConfigReader.3 index 303fdf0d9..6d130dd79 100644 --- a/docs/man/man3/ConfigReader.3 +++ b/docs/man/man3/ConfigReader.3 @@ -1,4 +1,4 @@ -.TH "ConfigReader" 3 "7 May 2005" "InspIRCd" \" -*- nroff -*- +.TH "ConfigReader" 3 "12 May 2005" "InspIRCd" \" -*- nroff -*- .ad l .nh .SH NAME @@ -89,213 +89,213 @@ Definition at line 1147 of file modules.h. .PP .SS "ConfigReader::ConfigReader ()" .PP -Default constructor. This constructor initialises the ConfigReader class to read the inspircd.conf file as specified when running ./configure.Definition at line 851 of file modules.cpp. +Default constructor. This constructor initialises the ConfigReader class to read the inspircd.conf file as specified when running ./configure.Definition at line 869 of file modules.cpp. .PP References cache, CONF_FILE_NOT_FOUND, error, errorlog, and readerror. .PP .nf -852 { -853 this->cache = new std::stringstream(std::stringstream::in | std::stringstream::out); -854 this->errorlog = new std::stringstream(std::stringstream::in | std::stringstream::out); -855 this->readerror = LoadConf(CONFIG_FILE,this->cache,this->errorlog); -856 if (!this->readerror) -857 this->error = CONF_FILE_NOT_FOUND; -858 } +870 { +871 this->cache = new std::stringstream(std::stringstream::in | std::stringstream::out); +872 this->errorlog = new std::stringstream(std::stringstream::in | std::stringstream::out); +873 this->readerror = LoadConf(CONFIG_FILE,this->cache,this->errorlog); +874 if (!this->readerror) +875 this->error = CONF_FILE_NOT_FOUND; +876 } .fi .SS "ConfigReader::ConfigReader (std::string filename)" .PP -Overloaded constructor. This constructor initialises the ConfigReader class to read a user-specified config fileDefinition at line 870 of file modules.cpp. +Overloaded constructor. This constructor initialises the ConfigReader class to read a user-specified config fileDefinition at line 888 of file modules.cpp. .PP References cache, CONF_FILE_NOT_FOUND, error, errorlog, and readerror. .PP .nf -871 { -872 this->cache = new std::stringstream(std::stringstream::in | std::stringstream::out); -873 this->errorlog = new std::stringstream(std::stringstream::in | std::stringstream::out); -874 this->readerror = LoadConf(filename.c_str(),this->cache,this->errorlog); -875 if (!this->readerror) -876 this->error = CONF_FILE_NOT_FOUND; -877 }; +889 { +890 this->cache = new std::stringstream(std::stringstream::in | std::stringstream::out); +891 this->errorlog = new std::stringstream(std::stringstream::in | std::stringstream::out); +892 this->readerror = LoadConf(filename.c_str(),this->cache,this->errorlog); +893 if (!this->readerror) +894 this->error = CONF_FILE_NOT_FOUND; +895 }; .fi .SS "ConfigReader::~\fBConfigReader\fP ()" .PP -Default destructor. This method destroys the ConfigReader class.Definition at line 861 of file modules.cpp. +Default destructor. This method destroys the ConfigReader class.Definition at line 879 of file modules.cpp. .PP References cache, and errorlog. .PP .nf -862 { -863 if (this->cache) -864 delete this->cache; -865 if (this->errorlog) -866 delete this->errorlog; -867 } +880 { +881 if (this->cache) +882 delete this->cache; +883 if (this->errorlog) +884 delete this->errorlog; +885 } .fi .SH "Member Function Documentation" .PP .SS "void ConfigReader::DumpErrors (bool bail, \fBuserrec\fP * user)" .PP -Dumps the list of errors in a config file to an output location. If bail is true, then the program will abort. If bail is false and user points to a valid user record, the error report will be spooled to the given user by means of NOTICE. if bool is false AND user is false, the error report will be spooled to all opers by means of a NOTICE to all opers.Definition at line 948 of file modules.cpp. +Dumps the list of errors in a config file to an output location. If bail is true, then the program will abort. If bail is false and user points to a valid user record, the error report will be spooled to the given user by means of NOTICE. if bool is false AND user is false, the error report will be spooled to all opers by means of a NOTICE to all opers.Definition at line 966 of file modules.cpp. .PP References errorlog, connection::fd, and userrec::nick. .PP .nf -949 { -950 if (bail) -951 { -952 printf('There were errors in your configuration:\n%s',errorlog->str().c_str()); -953 exit(0); -954 } -955 else -956 { -957 char dataline[1024]; -958 if (user) -959 { -960 WriteServ(user->fd,'NOTICE %s :There were errors in the configuration file:',user->nick); -961 while (!errorlog->eof()) -962 { -963 errorlog->getline(dataline,1024); -964 WriteServ(user->fd,'NOTICE %s :%s',user->nick,dataline); -965 } -966 } -967 else -968 { -969 WriteOpers('There were errors in the configuration file:',user->nick); -970 while (!errorlog->eof()) -971 { -972 errorlog->getline(dataline,1024); -973 WriteOpers(dataline); -974 } -975 } -976 return; -977 } -978 } +967 { +968 if (bail) +969 { +970 printf('There were errors in your configuration:\n%s',errorlog->str().c_str()); +971 exit(0); +972 } +973 else +974 { +975 char dataline[1024]; +976 if (user) +977 { +978 WriteServ(user->fd,'NOTICE %s :There were errors in the configuration file:',user->nick); +979 while (!errorlog->eof()) +980 { +981 errorlog->getline(dataline,1024); +982 WriteServ(user->fd,'NOTICE %s :%s',user->nick,dataline); +983 } +984 } +985 else +986 { +987 WriteOpers('There were errors in the configuration file:',user->nick); +988 while (!errorlog->eof()) +989 { +990 errorlog->getline(dataline,1024); +991 WriteOpers(dataline); +992 } +993 } +994 return; +995 } +996 } .fi .SS "int ConfigReader::Enumerate (std::string tag)" .PP -Counts the number of times a given tag appears in the config file. This method counts the number of times a tag appears in a config file, for use where there are several tags of the same kind, e.g. with opers and connect types. It can be used with the index value of \fBConfigReader::ReadValue\fP to loop through all copies of a multiple instance tag.Definition at line 981 of file modules.cpp. +Counts the number of times a given tag appears in the config file. This method counts the number of times a tag appears in a config file, for use where there are several tags of the same kind, e.g. with opers and connect types. It can be used with the index value of \fBConfigReader::ReadValue\fP to loop through all copies of a multiple instance tag.Definition at line 999 of file modules.cpp. .PP References cache. .PP .nf -982 { -983 return EnumConf(cache,tag.c_str()); -984 } +1000 { +1001 return EnumConf(cache,tag.c_str()); +1002 } .fi .SS "int ConfigReader::EnumerateValues (std::string tag, int index)" .PP -Returns the number of items within a tag. For example if the tag was <test tag='blah' data='foo'> then this function would return 2. Spaces and newlines both qualify as valid seperators between values.Definition at line 986 of file modules.cpp. +Returns the number of items within a tag. For example if the tag was <test tag='blah' data='foo'> then this function would return 2. Spaces and newlines both qualify as valid seperators between values.Definition at line 1004 of file modules.cpp. .PP References cache. .PP .nf -987 { -988 return EnumValues(cache, tag.c_str(), index); -989 } +1005 { +1006 return EnumValues(cache, tag.c_str(), index); +1007 } .fi .SS "long ConfigReader::GetError ()" .PP -Returns the last error to occur. Valid errors can be found by looking in \fBmodules.h\fP. Any nonzero value indicates an error condition. A call to \fBGetError()\fP resets the error flag back to 0.Definition at line 941 of file modules.cpp. +Returns the last error to occur. Valid errors can be found by looking in \fBmodules.h\fP. Any nonzero value indicates an error condition. A call to \fBGetError()\fP resets the error flag back to 0.Definition at line 959 of file modules.cpp. .PP References error. .PP .nf -942 { -943 long olderr = this->error; -944 this->error = 0; -945 return olderr; -946 } +960 { +961 long olderr = this->error; +962 this->error = 0; +963 return olderr; +964 } .fi .SS "bool ConfigReader::ReadFlag (std::string tag, std::string name, int index)" .PP -Retrieves a boolean value from the config file. This method retrieves a boolean value from the config file. Where multiple copies of the tag exist in the config file, index indicates which of the values to retrieve. The values '1', 'yes' and 'true' in the config file count as true to ReadFlag, and any other value counts as false.Definition at line 895 of file modules.cpp. +Retrieves a boolean value from the config file. This method retrieves a boolean value from the config file. Where multiple copies of the tag exist in the config file, index indicates which of the values to retrieve. The values '1', 'yes' and 'true' in the config file count as true to ReadFlag, and any other value counts as false.Definition at line 913 of file modules.cpp. .PP References cache, CONF_VALUE_NOT_FOUND, and error. .PP .nf -896 { -897 char val[MAXBUF]; -898 char t[MAXBUF]; -899 char n[MAXBUF]; -900 strlcpy(t,tag.c_str(),MAXBUF); -901 strlcpy(n,name.c_str(),MAXBUF); -902 int res = ReadConf(cache,t,n,index,val); -903 if (!res) -904 { -905 this->error = CONF_VALUE_NOT_FOUND; -906 return false; -907 } -908 std::string s = val; -909 return ((s == 'yes') || (s == 'YES') || (s == 'true') || (s == 'TRUE') || (s == '1')); -910 } +914 { +915 char val[MAXBUF]; +916 char t[MAXBUF]; +917 char n[MAXBUF]; +918 strlcpy(t,tag.c_str(),MAXBUF); +919 strlcpy(n,name.c_str(),MAXBUF); +920 int res = ReadConf(cache,t,n,index,val); +921 if (!res) +922 { +923 this->error = CONF_VALUE_NOT_FOUND; +924 return false; +925 } +926 std::string s = val; +927 return ((s == 'yes') || (s == 'YES') || (s == 'true') || (s == 'TRUE') || (s == '1')); +928 } .fi .SS "long ConfigReader::ReadInteger (std::string tag, std::string name, int index, bool needs_unsigned)" .PP -Retrieves an integer value from the config file. This method retrieves an integer value from the config file. Where multiple copies of the tag exist in the config file, index indicates which of the values to retrieve. Any invalid integer values in the tag will cause the objects error value to be set, and any call to \fBGetError()\fP will return CONF_INVALID_NUMBER to be returned. needs_unsigned is set if the number must be unsigned. If a signed number is placed into a tag which is specified unsigned, 0 will be returned and \fBGetError()\fP will return CONF_NOT_UNSIGNEDDefinition at line 912 of file modules.cpp. +Retrieves an integer value from the config file. This method retrieves an integer value from the config file. Where multiple copies of the tag exist in the config file, index indicates which of the values to retrieve. Any invalid integer values in the tag will cause the objects error value to be set, and any call to \fBGetError()\fP will return CONF_INVALID_NUMBER to be returned. needs_unsigned is set if the number must be unsigned. If a signed number is placed into a tag which is specified unsigned, 0 will be returned and \fBGetError()\fP will return CONF_NOT_UNSIGNEDDefinition at line 930 of file modules.cpp. .PP References cache, CONF_NOT_A_NUMBER, CONF_NOT_UNSIGNED, CONF_VALUE_NOT_FOUND, and error. .PP .nf -913 { -914 char val[MAXBUF]; -915 char t[MAXBUF]; -916 char n[MAXBUF]; -917 strlcpy(t,tag.c_str(),MAXBUF); -918 strlcpy(n,name.c_str(),MAXBUF); -919 int res = ReadConf(cache,t,n,index,val); -920 if (!res) -921 { -922 this->error = CONF_VALUE_NOT_FOUND; -923 return 0; -924 } -925 for (int i = 0; i < strlen(val); i++) -926 { -927 if (!isdigit(val[i])) -928 { -929 this->error = CONF_NOT_A_NUMBER; -930 return 0; -931 } -932 } -933 if ((needs_unsigned) && (atoi(val)<0)) -934 { -935 this->error = CONF_NOT_UNSIGNED; -936 return 0; -937 } -938 return atoi(val); -939 } +931 { +932 char val[MAXBUF]; +933 char t[MAXBUF]; +934 char n[MAXBUF]; +935 strlcpy(t,tag.c_str(),MAXBUF); +936 strlcpy(n,name.c_str(),MAXBUF); +937 int res = ReadConf(cache,t,n,index,val); +938 if (!res) +939 { +940 this->error = CONF_VALUE_NOT_FOUND; +941 return 0; +942 } +943 for (int i = 0; i < strlen(val); i++) +944 { +945 if (!isdigit(val[i])) +946 { +947 this->error = CONF_NOT_A_NUMBER; +948 return 0; +949 } +950 } +951 if ((needs_unsigned) && (atoi(val)<0)) +952 { +953 this->error = CONF_NOT_UNSIGNED; +954 return 0; +955 } +956 return atoi(val); +957 } .fi .SS "std::string ConfigReader::ReadValue (std::string tag, std::string name, int index)" .PP -Retrieves a value from the config file. This method retrieves a value from the config file. Where multiple copies of the tag exist in the config file, index indicates which of the values to retrieve.Definition at line 879 of file modules.cpp. +Retrieves a value from the config file. This method retrieves a value from the config file. Where multiple copies of the tag exist in the config file, index indicates which of the values to retrieve.Definition at line 897 of file modules.cpp. .PP References cache, CONF_VALUE_NOT_FOUND, and error. .PP .nf -880 { -881 char val[MAXBUF]; -882 char t[MAXBUF]; -883 char n[MAXBUF]; -884 strlcpy(t,tag.c_str(),MAXBUF); -885 strlcpy(n,name.c_str(),MAXBUF); -886 int res = ReadConf(cache,t,n,index,val); -887 if (!res) -888 { -889 this->error = CONF_VALUE_NOT_FOUND; -890 return ''; -891 } -892 return std::string(val); -893 } +898 { +899 char val[MAXBUF]; +900 char t[MAXBUF]; +901 char n[MAXBUF]; +902 strlcpy(t,tag.c_str(),MAXBUF); +903 strlcpy(n,name.c_str(),MAXBUF); +904 int res = ReadConf(cache,t,n,index,val); +905 if (!res) +906 { +907 this->error = CONF_VALUE_NOT_FOUND; +908 return ''; +909 } +910 return val; +911 } .fi .SS "bool ConfigReader::Verify ()" .PP -Returns true if a config file is valid. This method is partially implemented and will only return false if the config file does not exist or could not be opened.Definition at line 991 of file modules.cpp. +Returns true if a config file is valid. This method is partially implemented and will only return false if the config file does not exist or could not be opened.Definition at line 1009 of file modules.cpp. .PP References readerror. .PP .nf -992 { -993 return this->readerror; -994 } +1010 { +1011 return this->readerror; +1012 } .fi .SH "Member Data Documentation" .PP |