diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-11-02 16:48:48 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-11-02 16:48:48 +0100 |
commit | e11a7b3a0b7039af705ccb3a1c0bc7e21faa2bc6 (patch) | |
tree | 1f681b0fbddf0e9d43d3b3ea10dc4ad31830ee4a | |
parent | ef915eff1690bfded651bf6fcef02a977d3d676b (diff) | |
download | samba-e11a7b3a0b7039af705ccb3a1c0bc7e21faa2bc6.tar.gz |
Add utility function for getting the default loadparm context from a python module.
-rw-r--r-- | source4/param/param.i | 9 | ||||
-rw-r--r-- | source4/param/param_wrap.c | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/source4/param/param.i b/source4/param/param.i index 6158c92f802..c085ca2f053 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 23b3c17623e..8f4f529532b 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" { |