1 /******************************************************************************
2  *                    Internetting Cooperating Programmers
3  * ----------------------------------------------------------------------------
4  *
5  *  ____    PROJECT
6  * |  _ \  __ _ _ __   ___ ___ _ __
7  * | | | |/ _` | '_ \ / __/ _ \ '__|
8  * | |_| | (_| | | | | (_|  __/ |
9  * |____/ \__,_|_| |_|\___\___|_|   the IRC bot
10  *
11  * All files in this archive are subject to the GNU General Public License.
12  *
13  * $Source: /cvsroot/dancer/dancer/src/setup.h,v $
14  * $Revision: 1.1.1.1 $
15  * $Date: 2000/11/13 02:42:49 $
16  * $Author: holsta $
17  * $State: Exp $
18  * $Locker:  $
19  *
20  * ---------------------------------------------------------------------------
21  *****************************************************************************/
22 
23 #ifndef SETUP_H
24 #define SETUP_H
25 
26 struct Config {
27   char *label;
28   void *value;   /* pointer to the real storage */
29   void *def;     /* default value */
30   char flags;    /* specifies the kind of config setting, see defines below */
31   char setting;  /* value will be saved in setfile */
32   char *verbose; /* detailed description of the label */
33   bool changed;  /* read from .config or .set file */
34 };
35 
36 #define CFG_SWITCH   0 /* TRUE / FALSE */
37 #define CFG_INTEGER  1 /* 0 - 2G */
38 #define CFG_STRING   2 /* regular string, pointing to a static string area */
39 #define CFG_LIST     3 /* comma seperated list, uses itemlist */
40 #define CFG_FUNCTION 4 /* function */
41 #define CFG_COMMENT  5 /* Simply prints a comment to config file */
42 
43 #define BTRUE  (void *)1
44 #define BFALSE (void *)0
45 
46 
47 bool ConfigInit(void);
48 void ConfigCleanup(void);
49 
50 /******************************************************************************
51  * The following piece of source is the new SET functions.
52  *****************************************************************************/
53 
54 struct SetItem {
55   char *name;
56   long level;   /* if non-zero, different level required to access than for
57 		   rest of group */
58   long flags;   /* see below */
59   void *value;  /* pointer to the variable holding the info */
60   long ID;      /* for special ones */
61   char **help;  /* for localized strings, describe item */
62 };
63 
64 #define SET_ONOFF  1 /* just a toggle switch */
65 #define SET_NUM    2 /* integer */
66 #define SET_TIME   3 /* contains a time integer */
67 #define SET_SPEC   4 /* treat special */
68 #define SET_STRING 5 /* new in 4.7 */
69 
70 struct SetGroup {
71   char *name; /* name of group */
72   long level; /* level required to access (if different than 'SET') */
73   struct SetItem *group;
74   char **help; /* description of the group */
75 };
76 
77 
78 int SetSet(char *from, char *line);
79 int HelpSet(char *from, char *token);
80 void ShowSetAll(char *from);
81 void InitSets(void);
82 void MakeConfig(void);
83 void ChgCmdLev(char *, char *);
84 
85 #endif /* SETUP_H */
86