summaryrefslogtreecommitdiff
path: root/source4/param/param.i
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-01-16 09:00:04 +1100
committerAndrew Bartlett <abartlet@samba.org>2008-01-16 09:00:04 +1100
commitc92a1d0752abf42a76e16e7c19229841ac35dc81 (patch)
treef5702890d17180c6b33285c14b05bc53b0ca629c /source4/param/param.i
parent955b110818c00170f7b93d2975de467551c8bc06 (diff)
parentb1fcae724156c2b25f41264943cf4cec8fe68821 (diff)
downloadsamba-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.i21
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;
+}
+
+%}