fa9b78f6a603bd9ef6943f859dff33c498a8c5df
[samba.git] / source4 / param / loadparm.h
1 /* 
2    Unix SMB/CIFS implementation.
3    
4    type definitions for loadparm
5
6    Copyright (C) Karl Auer 1993-1998
7
8    Largely re-written by Andrew Tridgell, September 1994
9
10    Copyright (C) Simo Sorce 2001
11    Copyright (C) Alexander Bokovoy 2002
12    Copyright (C) Stefan (metze) Metzmacher 2002
13    Copyright (C) Jim McDonough (jmcd@us.ibm.com)  2003.
14    Copyright (C) James Myers 2003 <myersjj@samba.org>
15    
16    This program is free software; you can redistribute it and/or modify
17    it under the terms of the GNU General Public License as published by
18    the Free Software Foundation; either version 3 of the License, or
19    (at your option) any later version.
20    
21    This program is distributed in the hope that it will be useful,
22    but WITHOUT ANY WARRANTY; without even the implied warranty of
23    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24    GNU General Public License for more details.
25    
26    You should have received a copy of the GNU General Public License
27    along with this program.  If not, see <http://www.gnu.org/licenses/>.
28 */
29
30 /* the following are used by loadparm for option lists */
31 typedef enum {
32         P_BOOL,P_INTEGER,P_OCTAL,P_BYTES,P_LIST,P_STRING,P_USTRING,P_ENUM,P_SEP
33 } parm_type;
34
35 typedef enum {
36         P_LOCAL,P_GLOBAL,P_SEPARATOR,P_NONE
37 } parm_class;
38
39 struct enum_list {
40         int value;
41         const char *name;
42 };
43
44 struct parm_struct {
45         const char *label;
46         parm_type type;
47         parm_class class;
48         void *ptr;
49         BOOL (*special)(const char *, char **);
50         const struct enum_list *enum_list;
51         unsigned int flags;
52         union {
53                 int bvalue;
54                 int ivalue;
55                 char *svalue;
56                 char cvalue;
57                 const char **lvalue;
58         } def;
59 };
60
61 #define FLAG_BASIC      0x0001 /* fundamental options */
62 #define FLAG_SHARE      0x0002 /* file sharing options */
63 #define FLAG_PRINT      0x0004 /* printing options */
64 #define FLAG_GLOBAL     0x0008 /* local options that should be globally settable in SWAT */
65 #define FLAG_WIZARD     0x0010 /* Parameters that the wizard will operate on */
66 #define FLAG_ADVANCED   0x0020 /* Parameters that the wizard will operate on */
67 #define FLAG_DEVELOPER  0x0040 /* Parameters that the wizard will operate on */
68 #define FLAG_DEPRECATED 0x1000 /* options that should no longer be used */
69 #define FLAG_HIDE       0x2000 /* options that should be hidden in SWAT */
70 #define FLAG_DEFAULT    0x4000 /* this option was a default */
71 #define FLAG_CMDLINE    0x8000 /* this option was set from the command line */
72
73 #ifndef PRINTERS_NAME
74 #define PRINTERS_NAME "printers"
75 #endif
76
77 #ifndef HOMES_NAME
78 #define HOMES_NAME "homes"
79 #endif
80