summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-06 17:16:40 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:48:27 +0100
commitb440ed3df31b11d520c6d744cf53c54165f61b7a (patch)
treeb50bb6ee0a73020a6a8e9a70753415da1d503990 /source4/param
parent548c3e53574da71e1afc1ec31252478a1a2c303a (diff)
downloadsamba-b440ed3df31b11d520c6d744cf53c54165f61b7a.tar.gz
samba-b440ed3df31b11d520c6d744cf53c54165f61b7a.tar.bz2
samba-b440ed3df31b11d520c6d744cf53c54165f61b7a.zip
r26315: Avoid using lp_ functions in libcharset.
(This used to be commit db6dd425e3526c04e96d778a736dbb5cf14ddc56)
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/param.h1
-rw-r--r--source4/param/util.c16
2 files changed, 17 insertions, 0 deletions
diff --git a/source4/param/param.h b/source4/param/param.h
index 210b21d9a0..db948d8f11 100644
--- a/source4/param/param.h
+++ b/source4/param/param.h
@@ -64,5 +64,6 @@ struct loadparm_service;
extern struct loadparm_context *global_loadparm;
extern struct loadparm_service sDefault;
+extern struct smb_iconv_convenience *global_smb_iconv_convenience;
#endif /* _PARAM_H */
diff --git a/source4/param/util.c b/source4/param/util.c
index 8d59861f40..1cbae841bc 100644
--- a/source4/param/util.c
+++ b/source4/param/util.c
@@ -283,3 +283,19 @@ _PUBLIC_ const char *lp_messaging_path(TALLOC_CTX *mem_ctx,
return smbd_tmp_path(mem_ctx, lp_ctx, "messaging");
}
+struct smb_iconv_convenience *global_smb_iconv_convenience = NULL;
+
+struct smb_iconv_convenience *smb_iconv_convenience_init_lp(TALLOC_CTX *mem_ctx,
+ struct loadparm_context *lp_ctx)
+{
+ return smb_iconv_convenience_init(mem_ctx, lp_dos_charset(lp_ctx),
+ lp_unix_charset(lp_ctx),
+ lp_display_charset(lp_ctx),
+ lp_parm_bool(lp_ctx, NULL, "iconv", "native", true));
+}
+
+_PUBLIC_ void reload_charcnv(void)
+{
+ talloc_free(global_smb_iconv_convenience);
+ global_smb_iconv_convenience = smb_iconv_convenience_init_lp(talloc_autofree_context(), global_loadparm);
+}