diff options
Diffstat (limited to 'source4/param')
-rw-r--r-- | source4/param/config.mk | 2 | ||||
-rw-r--r-- | source4/param/param.i | 1 | ||||
-rw-r--r-- | source4/param/param.py | 1 | ||||
-rw-r--r-- | source4/param/param_wrap.c | 30 | ||||
-rw-r--r-- | source4/param/samba-config.pc.in | 10 | ||||
-rw-r--r-- | source4/param/tests/bindings.py | 3 |
6 files changed, 46 insertions, 1 deletions
diff --git a/source4/param/config.mk b/source4/param/config.mk index f7d5d03d43..8ded5f1a13 100644 --- a/source4/param/config.mk +++ b/source4/param/config.mk @@ -1,7 +1,7 @@ [LIBRARY::LIBSAMBA-CONFIG] -DESCRIPTION = Reading Samba configuration files VERSION = 0.0.1 SO_VERSION = 0 +PC_FILE = samba-config.pc OBJ_FILES = loadparm.o \ params.o \ generic.o \ diff --git a/source4/param/param.i b/source4/param/param.i index eeecb0e5b9..7322302117 100644 --- a/source4/param/param.i +++ b/source4/param/param.i @@ -50,6 +50,7 @@ typedef struct loadparm_context { %extend { loadparm_context(TALLOC_CTX *mem_ctx) { return loadparm_init(mem_ctx); } bool load(const char *filename) { return lp_load($self, filename); } + bool load_default() { return lp_load_default($self); } #ifdef SWIGPYTHON int __len__() { return lp_numservices($self); } struct loadparm_service *__getitem__(const char *name) { return lp_service($self, name); } diff --git a/source4/param/param.py b/source4/param/param.py index 66b51e5d3b..5adf7a4ecc 100644 --- a/source4/param/param.py +++ b/source4/param/param.py @@ -64,6 +64,7 @@ class LoadParm(object): _param.LoadParm_swiginit(self,_param.new_LoadParm(*args, **kwargs)) __swig_destroy__ = _param.delete_LoadParm LoadParm.load = new_instancemethod(_param.LoadParm_load,None,LoadParm) +LoadParm.load_default = new_instancemethod(_param.LoadParm_load_default,None,LoadParm) LoadParm.__len__ = new_instancemethod(_param.LoadParm___len__,None,LoadParm) LoadParm.__getitem__ = new_instancemethod(_param.LoadParm___getitem__,None,LoadParm) LoadParm.configfile = new_instancemethod(_param.LoadParm_configfile,None,LoadParm) diff --git a/source4/param/param_wrap.c b/source4/param/param_wrap.c index d8be725c5e..275e2d67ec 100644 --- a/source4/param/param_wrap.c +++ b/source4/param/param_wrap.c @@ -2602,6 +2602,7 @@ SWIGINTERNINLINE PyObject* return PyBool_FromLong(value ? 1 : 0); } +SWIGINTERN bool loadparm_context_load_default(loadparm_context *self){ return lp_load_default(self); } SWIGINTERN int loadparm_context___len__(loadparm_context *self){ return lp_numservices(self); } #define SWIG_From_long PyInt_FromLong @@ -2840,6 +2841,34 @@ fail: } +SWIGINTERN PyObject *_wrap_LoadParm_load_default(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + loadparm_context *arg1 = (loadparm_context *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + char * kwnames[] = { + (char *) "self", NULL + }; + + arg1 = loadparm_init(NULL); + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|O:LoadParm_load_default",kwnames,&obj0)) SWIG_fail; + if (obj0) { + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_loadparm_context, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LoadParm_load_default" "', argument " "1"" of type '" "loadparm_context *""'"); + } + arg1 = (loadparm_context *)(argp1); + } + result = (bool)loadparm_context_load_default(arg1); + resultobj = SWIG_From_bool((bool)(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_LoadParm___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; loadparm_context *arg1 = (loadparm_context *) 0 ; @@ -4050,6 +4079,7 @@ SWIGINTERN PyObject *Swig_var_default_config_get(void) { static PyMethodDef SwigMethods[] = { { (char *)"new_LoadParm", (PyCFunction)_wrap_new_LoadParm, METH_NOARGS, NULL}, { (char *)"LoadParm_load", (PyCFunction) _wrap_LoadParm_load, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"LoadParm_load_default", (PyCFunction) _wrap_LoadParm_load_default, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"LoadParm___len__", (PyCFunction) _wrap_LoadParm___len__, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"LoadParm___getitem__", (PyCFunction) _wrap_LoadParm___getitem__, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"LoadParm_configfile", (PyCFunction) _wrap_LoadParm_configfile, METH_VARARGS | METH_KEYWORDS, NULL}, diff --git a/source4/param/samba-config.pc.in b/source4/param/samba-config.pc.in new file mode 100644 index 0000000000..801f6aeda4 --- /dev/null +++ b/source4/param/samba-config.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: samba-config +Description: Reading Samba configuration files +Version: 0.0.1 +Libs: -L${libdir} -lsamba-config +Cflags: -I${includedir} -DHAVE_IMMEDIATE_STRUCTURES=1 diff --git a/source4/param/tests/bindings.py b/source4/param/tests/bindings.py index 9ea1c00daf..0dd186b9df 100644 --- a/source4/param/tests/bindings.py +++ b/source4/param/tests/bindings.py @@ -46,6 +46,9 @@ class LoadParmTestCase(unittest.TestCase): self.assertTrue(file.is_myname("BLA")) self.assertFalse(file.is_myname("FOOBAR")) + def test_load_default(self): + file = param.LoadParm() + file.load_default() class ParamTestCase(unittest.TestCase): def test_init(self): |