2 Unix SMB/CIFS implementation.
3 Parameter loading functions
4 Copyright (C) Andrew Bartlett 2011
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include "lib/param/s3_param.h"
23 static struct loadparm_service *lp_service_for_s4_ctx(const char *servicename)
26 struct loadparm_service *service;
28 mem_ctx = talloc_stackframe();
29 service = lp_service(servicename);
35 static struct loadparm_service *lp_servicebynum_for_s4_ctx(int servicenum)
38 struct loadparm_service *service;
40 mem_ctx = talloc_stackframe();
41 service = lp_servicebynum(servicenum);
47 static bool lp_load_for_s4_ctx(const char *filename)
52 mem_ctx = talloc_stackframe();
53 status = lp_load(filename, false, false, false, false);
59 static struct loadparm_s3_helpers s3_fns =
61 .get_parametric = lp_parm_const_string_service,
62 .get_parm_struct = lp_get_parameter,
63 .get_parm_ptr = lp_parm_ptr,
64 .get_service = lp_service_for_s4_ctx,
65 .get_servicebynum = lp_servicebynum_for_s4_ctx,
66 .getservicebyname = getservicebyname,
67 .get_default_loadparm_service = lp_default_loadparm_service,
68 .get_numservices = lp_numservices,
69 .load = lp_load_for_s4_ctx,
70 .set_cmdline = lp_set_cmdline,
72 .lp_string = lp_string,
73 .lp_string_set = lp_string_set,
74 .lp_include = lp_include,
75 .init_printer_values = init_printer_values,
76 .init_ldap_debugging = init_ldap_debugging,
79 const struct loadparm_s3_helpers *loadparm_s3_helpers(void)
81 struct loadparm_s3_helpers *helpers;
83 helpers->globals = get_globals();