Merge commit 'release-4-0-0alpha1' into v4-0-test
[ira/wip.git] / source / 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
33 } parm_type;
34
35 typedef enum {
36         P_LOCAL,P_GLOBAL,P_NONE
37 } parm_class;
38
39 struct enum_list {
40         int value;
41         const char *name;
42 };
43
44 struct loadparm_context;
45
46 struct parm_struct {
47         const char *label;
48         parm_type type;
49         parm_class class;
50         void *ptr;
51         bool (*special)(struct loadparm_context *, const char *, char **);
52         const struct enum_list *enum_list;
53         unsigned int flags;
54         union {
55                 int bvalue;
56                 int ivalue;
57                 char *svalue;
58                 char cvalue;
59                 const char **lvalue;
60         } def;
61 };
62
63 #define FLAG_BASIC      0x0001 /* fundamental options */
64 #define FLAG_SHARE      0x0002 /* file sharing options */
65 #define FLAG_PRINT      0x0004 /* printing options */
66 #define FLAG_GLOBAL     0x0008 /* local options that should be globally settable in SWAT */
67 #define FLAG_WIZARD     0x0010 /* Parameters that the wizard will operate on */
68 #define FLAG_ADVANCED   0x0020 /* Parameters that the wizard will operate on */
69 #define FLAG_DEVELOPER  0x0040 /* Parameters that the wizard will operate on */
70 #define FLAG_DEPRECATED 0x1000 /* options that should no longer be used */
71 #define FLAG_HIDE       0x2000 /* options that should be hidden in SWAT */
72 #define FLAG_DEFAULT    0x4000 /* this option was a default */
73 #define FLAG_CMDLINE    0x8000 /* this option was set from the command line */
74
75 #ifndef PRINTERS_NAME
76 #define PRINTERS_NAME "printers"
77 #endif
78
79 #ifndef HOMES_NAME
80 #define HOMES_NAME "homes"
81 #endif
82