]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/configreader.h
Make OnChannelRestrictionApply take a User* instead of a Membership* [jackmcbarn]
[user/henk/code/inspircd.git] / include / configreader.h
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
6  * See: http://wiki.inspircd.org/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #ifndef INSPIRCD_CONFIGREADER
15 #define INSPIRCD_CONFIGREADER
16
17 #include <sstream>
18 #include <string>
19 #include <vector>
20 #include <map>
21 #include "inspircd.h"
22 #include "modules.h"
23 #include "socketengine.h"
24 #include "socket.h"
25
26 /* Required forward definitions */
27 class ServerConfig;
28 class ServerLimits;
29 class InspIRCd;
30 class BufferedSocket;
31
32 /** A set of oper types
33  */
34 typedef std::map<irc::string,std::string> opertype_t;
35
36 /** Holds an oper class.
37  */
38 struct operclass_data : public classbase
39 {
40         /** Command list for the class
41          */
42         std::string commandlist;
43
44         /** Channel mode list for the class
45          */
46         std::string cmodelist;
47
48         /** User mode list for the class
49          */
50         std::string umodelist;
51
52         /** Priviledges given by this class
53          */
54         std::string privs;
55 };
56
57 /** A Set of oper classes
58  */
59 typedef std::map<irc::string, operclass_data> operclass_t;
60
61 /** Defines the server's length limits on various length-limited
62  * items such as topics, nicknames, channel names etc.
63  */
64 class ServerLimits
65 {
66  public:
67         /** Maximum nickname length */
68         size_t NickMax;
69         /** Maximum channel length */
70         size_t ChanMax;
71         /** Maximum number of modes per line */
72         size_t MaxModes;
73         /** Maximum length of ident, not including ~ etc */
74         size_t IdentMax;
75         /** Maximum length of a quit message */
76         size_t MaxQuit;
77         /** Maximum topic length */
78         size_t MaxTopic;
79         /** Maximum kick message length */
80         size_t MaxKick;
81         /** Maximum GECOS (real name) length */
82         size_t MaxGecos;
83         /** Maximum away message length */
84         size_t MaxAway;
85
86         /** Creating the class initialises it to the defaults
87          * as in 1.1's ./configure script. Reading other values
88          * from the config will change these values.
89          */
90         ServerLimits() : NickMax(31), ChanMax(64), MaxModes(20), IdentMax(12), MaxQuit(255), MaxTopic(307), MaxKick(255), MaxGecos(128), MaxAway(200)
91         {
92         }
93
94         /** Finalises the settings by adding one. This allows for them to be used as-is
95          * without a 'value+1' when using the std::string assignment methods etc.
96          */
97         void Finalise()
98         {
99                 NickMax++;
100                 ChanMax++;
101                 IdentMax++;
102                 MaxQuit++;
103                 MaxTopic++;
104                 MaxKick++;
105                 MaxGecos++;
106                 MaxAway++;
107         }
108 };
109
110 /** This class holds the bulk of the runtime configuration for the ircd.
111  * It allows for reading new config values, accessing configuration files,
112  * and storage of the configuration data needed to run the ircd, such as
113  * the servername, connect classes, /ADMIN data, MOTDs and filenames etc.
114  */
115 class CoreExport ServerConfig : public classbase
116 {
117   private:
118         /** This variable holds the names of all
119          * files included from the main one. This
120          * is used to make sure that no files are
121          * recursively included.
122          */
123         std::vector<std::string> include_stack;
124
125         /* classes removed by this rehash */
126         std::vector<ConnectClass*> removed_classes;
127
128         /** This private method processes one line of
129          * configutation, appending errors to errorstream
130          * and setting error if an error has occured.
131          */
132         bool ParseLine(const std::string &filename, std::string &line, long &linenumber, bool allowexeinc);
133
134         /** Check that there is only one of each configuration item
135          */
136         bool CheckOnce(const char* tag);
137
138         void CrossCheckOperClassType();
139         void CrossCheckConnectBlocks(ServerConfig* current);
140
141  public:
142         /** Process an include executable directive
143          */
144         bool DoPipe(const std::string &file);
145
146         /** Process an include file directive
147          */
148         bool DoInclude(const std::string &file, bool allowexeinc);
149
150         /** Error stream, contains error output from any failed configuration parsing.
151          */
152         std::stringstream errstr;
153
154         /** True if this configuration is valid enough to run with */
155         bool valid;
156
157         /** Set of included files. Do we use this any more?
158          */
159         std::map<std::string, std::istream*> IncludedFiles;
160
161         /** Used to indicate who we announce invites to on a channel */
162         enum InviteAnnounceState { INVITE_ANNOUNCE_NONE, INVITE_ANNOUNCE_ALL, INVITE_ANNOUNCE_OPS, INVITE_ANNOUNCE_DYNAMIC };
163
164         /** Not used any more as it is named, can probably be removed or renamed.
165          */
166         int DoDownloads();
167
168         /** This holds all the information in the config file,
169          * it's indexed by tag name to a vector of key/values.
170          */
171         ConfigDataHash config_data;
172
173         /** Length limits, see definition of ServerLimits class
174          */
175         ServerLimits Limits;
176
177         /** Clones CIDR range for ipv4 (0-32)
178          * Defaults to 32 (checks clones on all IPs seperately)
179          */
180         int c_ipv4_range;
181
182         /** Clones CIDR range for ipv6 (0-128)
183          * Defaults to 128 (checks on all IPs seperately)
184          */
185         int c_ipv6_range;
186
187         /** Max number of WhoWas entries per user.
188          */
189         int WhoWasGroupSize;
190
191         /** Max number of cumulative user-entries in WhoWas.
192          *  When max reached and added to, push out oldest entry FIFO style.
193          */
194         int WhoWasMaxGroups;
195
196         /** Max seconds a user is kept in WhoWas before being pruned.
197          */
198         int WhoWasMaxKeep;
199
200         /** Both for set(g|u)id.
201          */
202         std::string SetUser;
203         std::string SetGroup;
204
205         /** Holds the server name of the local server
206          * as defined by the administrator.
207          */
208         std::string ServerName;
209
210         /** Notice to give to users when they are Xlined
211          */
212         std::string MoronBanner;
213
214         /* Holds the network name the local server
215          * belongs to. This is an arbitary field defined
216          * by the administrator.
217          */
218         std::string Network;
219
220         /** Holds the description of the local server
221          * as defined by the administrator.
222          */
223         std::string ServerDesc;
224
225         /** Holds the admin's name, for output in
226          * the /ADMIN command.
227          */
228         std::string AdminName;
229
230         /** Holds the email address of the admin,
231          * for output in the /ADMIN command.
232          */
233         std::string AdminEmail;
234
235         /** Holds the admin's nickname, for output
236          * in the /ADMIN command
237          */
238         std::string AdminNick;
239
240         /** The admin-configured /DIE password
241          */
242         std::string diepass;
243
244         /** The admin-configured /RESTART password
245          */
246         std::string restartpass;
247
248         /** The hash method for *BOTH* the die and restart passwords.
249          */
250         std::string powerhash;
251
252         /** The pathname and filename of the message of the
253          * day file, as defined by the administrator.
254          */
255         std::string motd;
256
257         /** The pathname and filename of the rules file,
258          * as defined by the administrator.
259          */
260         std::string rules;
261
262         /** The quit prefix in use, or an empty string
263          */
264         std::string PrefixQuit;
265
266         /** The quit suffix in use, or an empty string
267          */
268         std::string SuffixQuit;
269
270         /** The fixed quit message in use, or an empty string
271          */
272         std::string FixedQuit;
273
274         /** The part prefix in use, or an empty string
275          */
276         std::string PrefixPart;
277
278         /** The part suffix in use, or an empty string
279          */
280         std::string SuffixPart;
281
282         /** The fixed part message in use, or an empty string
283          */
284         std::string FixedPart;
285
286         /** The last string found within a <die> tag, or
287          * an empty string.
288          */
289         std::string DieValue;
290
291         /** The DNS server to use for DNS queries
292          */
293         std::string DNSServer;
294
295         /** Pretend disabled commands don't exist.
296          */
297         bool DisabledDontExist;
298
299         /** This variable contains a space-seperated list
300          * of commands which are disabled by the
301          * administrator of the server for non-opers.
302          */
303         std::string DisabledCommands;
304
305         /** This variable identifies which usermodes have been diabled.
306          */
307
308         char DisabledUModes[64];
309
310         /** This variable identifies which chanmodes have been disabled.
311          */
312         char DisabledCModes[64];
313
314         /** The full path to the modules directory.
315          * This is either set at compile time, or
316          * overridden in the configuration file via
317          * the <options> tag.
318          */
319         std::string ModPath;
320
321         /** The full pathname to the executable, as
322          * given in argv[0] when the program starts.
323          */
324         std::string MyExecutable;
325
326         /** The file handle of the logfile. If this
327          * value is NULL, the log file is not open,
328          * probably due to a permissions error on
329          * startup (this should not happen in normal
330          * operation!).
331          */
332         FILE *log_file;
333
334         /** If this value is true, the owner of the
335          * server specified -nofork on the command
336          * line, causing the daemon to stay in the
337          * foreground.
338          */
339         bool nofork;
340
341         /** If this value if true then all log
342          * messages will be output, regardless of
343          * the level given in the config file.
344          * This is set with the -debug commandline
345          * option.
346          */
347         bool forcedebug;
348
349         /** If this is true then log output will be
350          * written to the logfile. This is the default.
351          * If you put -nolog on the commandline then
352          * the logfile will not be written.
353          * This is meant to be used in conjunction with
354          * -debug for debugging without filling up the
355          * hard disk.
356          */
357         bool writelog;
358
359         /** If set to true, then all opers on this server are
360          * shown with a generic 'is an IRC operator' line rather
361          * than the oper type. Oper types are still used internally.
362          */
363         bool GenericOper;
364
365         /** If this value is true, banned users (+b, not extbans) will not be able to change nick
366          * if banned on any channel, nor to message them.
367          */
368         bool RestrictBannedUsers;
369
370         /** If this value is true, halfops have been
371          * enabled in the configuration file.
372          */
373         bool AllowHalfop;
374
375         /** If this is set to true, then mode lists (e.g
376          * MODE #chan b) are hidden from unprivileged
377          * users.
378          */
379         bool HideModeLists[256];
380
381         /** The number of seconds the DNS subsystem
382          * will wait before timing out any request.
383          */
384         int dns_timeout;
385
386         /** The size of the read() buffer in the user
387          * handling code, used to read data into a user's
388          * recvQ.
389          */
390         int NetBufferSize;
391
392         /** The value to be used for listen() backlogs
393          * as default.
394          */
395         int MaxConn;
396
397         /** The soft limit value assigned to the irc server.
398          * The IRC server will not allow more than this
399          * number of local users.
400          */
401         unsigned int SoftLimit;
402
403         /** Maximum number of targets for a multi target command
404          * such as PRIVMSG or KICK
405          */
406         unsigned int MaxTargets;
407
408         /** The maximum number of /WHO results allowed
409          * in any single /WHO command.
410          */
411         int MaxWhoResults;
412
413         /** True if the DEBUG loglevel is selected.
414          */
415         int debugging;
416
417         /** How many seconds to wait before exiting
418          * the program when /DIE is correctly issued.
419          */
420         int DieDelay;
421
422         /** True if we're going to hide netsplits as *.net *.split for non-opers
423          */
424         bool HideSplits;
425
426         /** True if we're going to hide ban reasons for non-opers (e.g. G-Lines,
427          * K-Lines, Z-Lines)
428          */
429         bool HideBans;
430
431         /** Announce invites to the channel with a server notice
432          */
433         InviteAnnounceState AnnounceInvites;
434
435         /** If this is enabled then operators will
436          * see invisible (+i) channels in /whois.
437          */
438         bool OperSpyWhois;
439
440         /** Set to a non-empty string to obfuscate the server name of users in WHOIS
441          */
442         std::string HideWhoisServer;
443
444         /** Set to a non empty string to obfuscate nicknames prepended to a KILL.
445          */
446         std::string HideKillsServer;
447
448         /** The MOTD file, cached in a file_cache type.
449          */
450         file_cache MOTD;
451
452         /** The RULES file, cached in a file_cache type.
453          */
454         file_cache RULES;
455
456         /** The full pathname and filename of the PID
457          * file as defined in the configuration.
458          */
459         std::string PID;
460
461         /** The connect classes in use by the IRC server.
462          */
463         ClassVector Classes;
464
465         /** The 005 tokens of this server (ISUPPORT)
466          * populated/repopulated upon loading or unloading
467          * modules.
468          */
469         std::string data005;
470
471         /** isupport strings
472          */
473         std::vector<std::string> isupport;
474
475         /** STATS characters in this list are available
476          * only to operators.
477          */
478         std::string UserStats;
479
480         /** The path and filename of the ircd.log file
481          */
482         std::string logpath;
483
484         /** Default channel modes
485          */
486         std::string DefaultModes;
487
488         /** Custom version string, which if defined can replace the system info in VERSION.
489          */
490         std::string CustomVersion;
491
492         /** List of u-lined servers
493          */
494         std::map<irc::string, bool> ulines;
495
496         /** Max banlist sizes for channels (the std::string is a glob)
497          */
498         std::map<std::string, int> maxbans;
499
500         /** Directory where the inspircd binary resides
501          */
502         std::string MyDir;
503
504         /** If set to true, no user DNS lookups are to be performed
505          */
506         bool NoUserDns;
507
508         /** If set to true, provide syntax hints for unknown commands
509          */
510         bool SyntaxHints;
511
512         /** If set to true, users appear to quit then rejoin when their hosts change.
513          * This keeps clients synchronized properly.
514          */
515         bool CycleHosts;
516
517         /** If set to true, prefixed channel NOTICEs and PRIVMSGs will have the prefix
518          *  added to the outgoing text for undernet style msg prefixing.
519          */
520         bool UndernetMsgPrefix;
521
522         /** If set to true, the full nick!user@host will be shown in the TOPIC command
523          * for who set the topic last. If false, only the nick is shown.
524          */
525         bool FullHostInTopic;
526
527         /** All oper type definitions from the config file
528          */
529         opertype_t opertypes;
530
531         /** All oper class definitions from the config file
532          */
533         operclass_t operclass;
534
535         /** Saved argv from startup
536          */
537         char** argv;
538
539         /** Saved argc from startup
540          */
541         int argc;
542
543         /** Max channels per user
544          */
545         unsigned int MaxChans;
546
547         /** Oper max channels per user
548          */
549         unsigned int OperMaxChans;
550
551         /** TS6-like server ID.
552          * NOTE: 000...999 are usable for InspIRCd servers. This
553          * makes code simpler. 0AA, 1BB etc with letters are reserved
554          * for services use.
555          */
556         std::string sid;
557
558         /** True if we have been told to run the testsuite from the commandline,
559          * rather than entering the mainloop.
560          */
561         bool TestSuite;
562
563         /** Construct a new ServerConfig
564          */
565         ServerConfig();
566
567         /** Get server ID as string with required leading zeroes
568          */
569         std::string GetSID();
570
571         /** Update the 005 vector
572          */
573         void Update005();
574
575         /** Send the 005 numerics (ISUPPORT) to a user
576          */
577         void Send005(User* user);
578
579         /** Read the entire configuration into memory
580          * and initialize this class. All other methods
581          * should be used only by the core.
582          */
583         void Read();
584
585         /** Apply configuration changes from the old configuration.
586          */
587         void Apply(ServerConfig* old, const std::string &useruid);
588         void ApplyModules(User* user);
589
590         /** Read a file into a file_cache object
591          */
592         bool ReadFile(file_cache &F, const char* fname);
593
594         /* Returns true if the given string starts with a windows drive letter
595          */
596         bool StartsWithWindowsDriveLetter(const std::string &path);
597
598         /** Load 'filename' into 'target', with the new config parser everything is parsed into
599          * tag/key/value at load-time rather than at read-value time.
600          */
601         bool LoadConf(FILE* &conf, const char* filename, bool allowexeinc);
602
603         /** Load 'filename' into 'target', with the new config parser everything is parsed into
604          * tag/key/value at load-time rather than at read-value time.
605          */
606         bool LoadConf(FILE* &conf, const std::string &filename, bool allowexeinc);
607
608         /** Writes 'length' chars into 'result' as a string
609          */
610         bool ConfValue(const char* tag, const char* var, int index, char* result, int length, bool allow_linefeeds = false);
611
612         /** Writes 'length' chars into 'result' as a string
613          */
614         bool ConfValue(const char* tag, const char* var, const char* default_value, int index, char* result, int length, bool allow_linefeeds = false);
615
616         /** Writes 'length' chars into 'result' as a string
617          */
618         bool ConfValue(const std::string &tag, const std::string &var, int index, std::string &result, bool allow_linefeeds = false);
619
620         /** Writes 'length' chars into 'result' as a string
621          */
622         bool ConfValue(const std::string &tag, const std::string &var, const std::string &default_value, int index, std::string &result, bool allow_linefeeds = false);
623
624         /** Tries to convert the value to an integer and write it to 'result'
625          */
626         bool ConfValueInteger(const char* tag, const char* var, int index, int &result);
627
628         /** Tries to convert the value to an integer and write it to 'result'
629          */
630         bool ConfValueInteger(const char* tag, const char* var, const char* default_value, int index, int &result);
631
632         /** Tries to convert the value to an integer and write it to 'result'
633          */
634         bool ConfValueInteger(const std::string &tag, const std::string &var, int index, int &result);
635
636         /** Tries to convert the value to an integer and write it to 'result'
637          */
638         bool ConfValueInteger(const std::string &tag, const std::string &var, const std::string &default_value, int index, int &result);
639
640         /** Returns true if the value exists and has a true value, false otherwise
641          */
642         bool ConfValueBool(const char* tag, const char* var, int index);
643
644         /** Returns true if the value exists and has a true value, false otherwise
645          */
646         bool ConfValueBool(const char* tag, const char* var, const char* default_value, int index);
647
648         /** Returns true if the value exists and has a true value, false otherwise
649          */
650         bool ConfValueBool(const std::string &tag, const std::string &var, int index);
651
652         /** Returns true if the value exists and has a true value, false otherwise
653          */
654         bool ConfValueBool(const std::string &tag, const std::string &var, const std::string &default_value, int index);
655
656         /** Returns the number of occurences of tag in the config file
657          */
658         int ConfValueEnum(const char* tag);
659         /** Returns the number of occurences of tag in the config file
660          */
661         int ConfValueEnum(const std::string &tag);
662
663         /** Returns the numbers of vars inside the index'th 'tag in the config file
664          */
665         int ConfVarEnum(const char* tag, int index);
666         /** Returns the numbers of vars inside the index'th 'tag in the config file
667          */
668         int ConfVarEnum(const std::string &tag, int index);
669
670         bool ApplyDisabledCommands(const std::string& data);
671
672         /** Returns the fully qualified path to the inspircd directory
673          * @return The full program directory
674          */
675         std::string GetFullProgDir();
676
677         /** Clean a filename, stripping the directories (and drives) from string.
678          * @param name Directory to tidy
679          * @return The cleaned filename
680          */
681         static const char* CleanFilename(const char* name);
682
683         /** Check if a file exists.
684          * @param file The full path to a file
685          * @return True if the file exists and is readable.
686          */
687         static bool FileExists(const char* file);
688
689         /** If this value is true, invites will bypass more than just +i
690          */
691         bool InvBypassModes;
692
693 };
694
695
696 /** Types of data in the core config
697  */
698 enum ConfigDataType
699 {
700         DT_NOTHING       = 0,           /* No data */
701         DT_INTEGER       = 1,           /* Integer */
702         DT_CHARPTR       = 2,           /* Char pointer */
703         DT_BOOLEAN       = 3,           /* Boolean */
704         DT_HOSTNAME      = 4,           /* Hostname syntax */
705         DT_NOSPACES      = 5,           /* No spaces */
706         DT_IPADDRESS     = 6,           /* IP address (v4, v6) */
707         DT_CHANNEL       = 7,           /* Channel name */
708         DT_LIMIT     = 8,       /* size_t */
709         DT_ALLOW_WILD    = 64,          /* Allow wildcards/CIDR in DT_IPADDRESS */
710         DT_ALLOW_NEWLINE = 128          /* New line characters allowed in DT_CHARPTR */
711 };
712
713 /** The maximum number of values in a core configuration tag. Can be increased if needed.
714  */
715 #define MAX_VALUES_PER_TAG 18
716
717 /** Holds a config value, either string, integer or boolean.
718  * Callback functions receive one or more of these, either on
719  * their own as a reference, or in a reference to a deque of them.
720  * The callback function can then alter the values of the ValueItem
721  * classes to validate the settings.
722  */
723 class ValueItem
724 {
725         /** Actual data */
726         std::string v;
727  public:
728         /** Initialize with an int */
729         ValueItem(int value);
730         /** Initialize with a bool */
731         ValueItem(bool value);
732         /** Initialize with a string */
733         ValueItem(const char* value) : v(value) { }
734         /** Change value to a string */
735         void Set(const std::string &val);
736         /** Change value to an int */
737         void Set(int value);
738         /** Get value as an int */
739         int GetInteger();
740         /** Get value as a string */
741         const char* GetString() const;
742         /** Get value as a string */
743         inline const std::string& GetValue() const { return v; }
744         /** Get value as a bool */
745         bool GetBool();
746 };
747
748 /** The base class of the container 'ValueContainer'
749  * used internally by the core to hold core values.
750  */
751 class ValueContainerBase
752 {
753  public:
754         /** Constructor */
755         ValueContainerBase() { }
756         /** Destructor */
757         virtual ~ValueContainerBase() { }
758 };
759
760 /** ValueContainer is used to contain pointers to different
761  * core values such as the server name, maximum number of
762  * clients etc.
763  * It is specialized to hold a data type, then pointed at
764  * a value in the ServerConfig class. When the value has been
765  * read and validated, the Set method is called to write the
766  * value safely in a type-safe manner.
767  */
768 template<typename T> class ValueContainer : public ValueContainerBase
769 {
770         T ServerConfig::* const vptr;
771  public:
772         /** Initialize with a value of type T */
773         ValueContainer(T ServerConfig::* const offset) : vptr(offset)
774         {
775         }
776
777         /** Change value to type T of size s */
778         void Set(ServerConfig* conf, const T& value)
779         {
780                 conf->*vptr = value;
781         }
782
783         void Set(ServerConfig* conf, const ValueItem& item);
784 };
785
786 class ValueContainerLimit : public ValueContainerBase
787 {
788         size_t ServerLimits::* const vptr;
789  public:
790         /** Initialize with a value of type T */
791         ValueContainerLimit(size_t ServerLimits::* const offset) : vptr(offset)
792         {
793         }
794
795         /** Change value to type T of size s */
796         void Set(ServerConfig* conf, const size_t& value)
797         {
798                 conf->Limits.*vptr = value;
799         }
800 };
801
802 /** A specialization of ValueContainer to hold a pointer to a bool
803  */
804 typedef ValueContainer<bool> ValueContainerBool;
805
806 /** A specialization of ValueContainer to hold a pointer to
807  * an unsigned int
808  */
809 typedef ValueContainer<unsigned int> ValueContainerUInt;
810
811 /** A specialization of ValueContainer to hold a pointer to
812  * a char array.
813  */
814 typedef ValueContainer<std::string> ValueContainerString;
815
816 /** A specialization of ValueContainer to hold a pointer to
817  * an int
818  */
819 typedef ValueContainer<int> ValueContainerInt;
820
821 /** A set of ValueItems used by multi-value validator functions
822  */
823 typedef std::deque<ValueItem> ValueList;
824
825 /** A callback for validating a single value
826  */
827 typedef bool (*Validator)(ServerConfig* conf, const char*, const char*, ValueItem&);
828 /** A callback for validating multiple value entries
829  */
830 typedef bool (*MultiValidator)(ServerConfig* conf, const char*, const char**, ValueList&, int*);
831 /** A callback indicating the end of a group of entries
832  */
833 typedef bool (*MultiNotify)(ServerConfig* conf, const char*);
834
835 /** Holds a core configuration item and its callbacks
836  */
837 struct InitialConfig
838 {
839         /** Tag name */
840         const char* tag;
841         /** Value name */
842         const char* value;
843         /** Default, if not defined */
844         const char* default_value;
845         /** Value containers */
846         ValueContainerBase* val;
847         /** Data types */
848         int datatype;
849         /** Validation function */
850         Validator validation_function;
851 };
852
853 /** Represents a deprecated configuration tag.
854  */
855 struct Deprecated
856 {
857         /** Tag name
858          */
859         const char* tag;
860         /** Tag value
861          */
862         const char* value;
863         /** Reason for deprecation
864          */
865         const char* reason;
866 };
867
868 /** Holds a core configuration item and its callbacks
869  * where there may be more than one item
870  */
871 struct MultiConfig
872 {
873         /** Tag name */
874         const char*     tag;
875         /** One or more items within tag */
876         const char*     items[MAX_VALUES_PER_TAG];
877         /** One or more defaults for items within tags */
878         const char* items_default[MAX_VALUES_PER_TAG];
879         /** One or more data types */
880         int             datatype[MAX_VALUES_PER_TAG];
881         /** Validation function */
882         MultiValidator  validation_function;
883 };
884
885 #endif