Remove dependency of charset code on loadparm.
[kai/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
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         int offset;
51         bool (*special)(struct loadparm_context *, const char *, char **);
52         const struct enum_list *enum_list;
53         union {
54                 int bvalue;
55                 int ivalue;
56                 char *svalue;
57                 char cvalue;
58                 const char **lvalue;
59         } def;
60 };
61
62
63
64
65 #define FLAG_DEFAULT    0x0001 /* this option was a default */
66 #define FLAG_CMDLINE    0x0002 /* this option was set from the command line */
67
68 #ifndef PRINTERS_NAME
69 #define PRINTERS_NAME "printers"
70 #endif
71
72 #ifndef HOMES_NAME
73 #define HOMES_NAME "homes"
74 #endif
75