summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-11-02 16:48:48 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-11-02 16:48:48 +0100
commite11a7b3a0b7039af705ccb3a1c0bc7e21faa2bc6 (patch)
tree1f681b0fbddf0e9d43d3b3ea10dc4ad31830ee4a /source4/param
parentef915eff1690bfded651bf6fcef02a977d3d676b (diff)
downloadsamba-e11a7b3a0b7039af705ccb3a1c0bc7e21faa2bc6.tar.gz
samba-e11a7b3a0b7039af705ccb3a1c0bc7e21faa2bc6.tar.bz2
samba-e11a7b3a0b7039af705ccb3a1c0bc7e21faa2bc6.zip
Add utility function for getting the default loadparm context from a python module.
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/param.i9
-rw-r--r--source4/param/param_wrap.c9
2 files changed, 18 insertions, 0 deletions
diff --git a/source4/param/param.i b/source4/param/param.i
index 6158c92f80..c085ca2f05 100644
--- a/source4/param/param.i
+++ b/source4/param/param.i
@@ -344,4 +344,13 @@ struct loadparm_context *lp_from_py_object(PyObject *py_obj)
return lp_ctx;
}
+struct loadparm_context *py_default_loadparm_context(TALLOC_CTX *mem_ctx)
+{
+ struct loadparm_context *ret;
+ ret = loadparm_init(mem_ctx);
+ if (!lp_load_default(ret))
+ return NULL;
+ return ret;
+}
+
%}
diff --git a/source4/param/param_wrap.c b/source4/param/param_wrap.c
index 23b3c17623..8f4f529532 100644
--- a/source4/param/param_wrap.c
+++ b/source4/param/param_wrap.c
@@ -2814,6 +2814,15 @@ struct loadparm_context *lp_from_py_object(PyObject *py_obj)
return lp_ctx;
}
+struct loadparm_context *py_default_loadparm_context(TALLOC_CTX *mem_ctx)
+{
+ struct loadparm_context *ret;
+ ret = loadparm_init(mem_ctx);
+ if (!lp_load_default(ret))
+ return NULL;
+ return ret;
+}
+
#ifdef __cplusplus
extern "C" {