s4-param Handle P_CHAR and P_BOOLREV in pyparam
authorAndrew Bartlett <abartlet@samba.org>
Fri, 15 Jul 2011 01:37:39 +0000 (11:37 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 19 Jul 2011 23:17:09 +0000 (09:17 +1000)
Signed-off-by: Andrew Tridgell <tridge@samba.org>
source4/param/pyparam.c

index c07892cc541626dc1f05d97e690658ff21786252..470c535fafc0caca1dd1a014a1176c4651ed8ccb 100644 (file)
@@ -106,11 +106,15 @@ static PyObject *py_lp_ctx_get_helper(struct loadparm_context *lp_ctx, const cha
 
     /* construct and return the right type of python object */
     switch (parm->type) {
+    case P_CHAR:
+       return PyString_FromFormat("%c", *(char *)parm_ptr);
     case P_STRING:
     case P_USTRING:
        return PyString_FromString(*(char **)parm_ptr);
     case P_BOOL:
        return PyBool_FromLong(*(bool *)parm_ptr);
+    case P_BOOLREV:
+       return PyBool_FromLong(!(*(bool *)parm_ptr));
     case P_INTEGER:
     case P_OCTAL:
     case P_BYTES: