Add utility function for getting the default loadparm context from a python module.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 2 Nov 2008 15:48:48 +0000 (16:48 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 2 Nov 2008 15:48:48 +0000 (16:48 +0100)
source4/param/param.i
source4/param/param_wrap.c

index 6158c92f802a5b9cb3bcd9717ffe9ef44cedb5eb..c085ca2f0539ecaf768e941822a3b0a83321a841 100644 (file)
@@ -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;
+}
+
 %}
index 23b3c17623ed06145b9aa8c8eed75bd47abef0d8..8f4f529532bcb1a1032a7d2c10eee1d70ac0335d 100644 (file)
@@ -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" {