diff options
author | Andrew Bartlett <abartlet@samba.org> | 2008-01-16 09:00:04 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2008-01-16 09:00:04 +1100 |
commit | c92a1d0752abf42a76e16e7c19229841ac35dc81 (patch) | |
tree | f5702890d17180c6b33285c14b05bc53b0ca629c /source4/param/param.i | |
parent | 955b110818c00170f7b93d2975de467551c8bc06 (diff) | |
parent | b1fcae724156c2b25f41264943cf4cec8fe68821 (diff) | |
download | samba-c92a1d0752abf42a76e16e7c19229841ac35dc81.tar.gz samba-c92a1d0752abf42a76e16e7c19229841ac35dc81.tar.bz2 samba-c92a1d0752abf42a76e16e7c19229841ac35dc81.zip |
Merge branch 'v4-0-test' of git://git.samba.org/samba into 4-0-local
(This used to be commit d8a805a2544c8864136f77e9086b2a01ae79a1d5)
Diffstat (limited to 'source4/param/param.i')
-rw-r--r-- | source4/param/param.i | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source4/param/param.i b/source4/param/param.i index 353fa3ced6..eeecb0e5b9 100644 --- a/source4/param/param.i +++ b/source4/param/param.i @@ -290,3 +290,24 @@ typedef struct param_section { %rename(default_config) global_loadparm; struct loadparm_context *global_loadparm; + +%{ + +struct loadparm_context *lp_from_py_object(PyObject *py_obj) +{ + struct loadparm_context *lp_ctx; + if (PyString_Check(py_obj)) { + lp_ctx = loadparm_init(NULL); + if (!lp_load(lp_ctx, PyString_AsString(py_obj))) { + talloc_free(lp_ctx); + return NULL; + } + return lp_ctx; + } + + if (SWIG_ConvertPtr(py_obj, (void *)&lp_ctx, SWIGTYPE_p_loadparm_context, 0 | 0 ) < 0) + return NULL; + return lp_ctx; +} + +%} |