}
#ifdef SWIGPYTHON
-%typemap(argout) struct ldb_result ** (int i) {
+%typemap(argout,noblock=1) struct ldb_result ** (int i) {
$result = PyList_New((*$1)->count);
for (i = 0; i < (*$1)->count; i++) {
PyList_SetItem($result, i,
}
}
-%typemap(freearg) const char * const *attrs {
+%typemap(freearg,noblock=1) const char * const *attrs {
talloc_free($1);
}
#endif
return ret;
}
~ldb_msg() { talloc_free($self); }
-
ldb_msg_element *find_element(const char *name);
#ifdef SWIGPYTHON
}
%}
-%typemap(in,numinputs=1) (void (*debug)(void *context, enum ldb_debug_level level, const char *fmt, va_list ap),
- void *context) {
+%typemap(in,numinputs=1,noblock=1) (void (*debug)(void *context, enum ldb_debug_level level, const char *fmt, va_list ap), void *context) {
$1 = py_ldb_debug;
/* FIXME: Should be decreased somewhere as well. Perhaps register a
destructor and tie it to the ldb context ? */
PyObject *key, *value;
ldb_msg_element *msgel;
ldb_msg *msg = NULL;
+
if (PyDict_Check(py_msg)) {
msg = ldb_msg_new(NULL);
msg->elements = talloc_zero_array(msg, struct ldb_message_element, PyDict_Size(py_msg));
return LDB_ERR_OTHER;
}
- ret = ldb_add($self,msg);
+ ret = ldb_add($self, msg);
talloc_free(msg);
return ret;
ldb_error transaction_cancel();
#ifdef SWIGPYTHON
- %typemap(in,numinputs=0) struct ldb_result **result_as_bool (struct ldb_result *tmp) { $1 = &tmp; }
- %typemap(argout) struct ldb_result **result_as_bool { $result = ((*$1)->count > 0)?Py_True:Py_False; }
- %typemap(freearg) struct ldb_result **result_as_bool { talloc_free(*$1); }
+ %typemap(in,numinputs=0,noblock=1) struct ldb_result **result_as_bool (struct ldb_result *tmp) { $1 = &tmp; }
+ %typemap(argout,noblock=1) struct ldb_result **result_as_bool { $result = ((*$1)->count > 0)?Py_True:Py_False; }
+ %typemap(freearg,noblock=1) struct ldb_result **result_as_bool { talloc_free(*$1); }
ldb_error __contains__(ldb_dn *dn, struct ldb_result **result_as_bool)
{
return ldb_search($self, dn, LDB_SCOPE_BASE, NULL, NULL,
%rename(string_to_time) ldb_string_to_time;
time_t ldb_string_to_time(const char *s);
-%typemap(in) const struct ldb_module_ops * {
+%typemap(in,noblock=1) const struct ldb_module_ops * {
$1 = talloc_zero(talloc_autofree_context(), struct ldb_module_ops);
$1->name = (char *)PyObject_GetAttrString($input, (char *)"name");
PyObject *key, *value;
ldb_msg_element *msgel;
ldb_msg *msg = NULL;
+
if (PyDict_Check(py_msg)) {
msg = ldb_msg_new(NULL);
msg->elements = talloc_zero_array(msg, struct ldb_message_element, PyDict_Size(py_msg));
return 80;
}
- ret = ldb_add(self,msg);
+ ret = ldb_add(self, msg);
talloc_free(msg);
return ret;
SWIG_fail;
}
resultobj = Py_None;
- {
- resultobj = PyList_New((*arg6)->count);
- for (i6 = 0; i6 < (*arg6)->count; i6++) {
- PyList_SetItem(resultobj, i6,
- SWIG_NewPointerObj((*arg6)->msgs[i6], SWIGTYPE_p_ldb_message, 0)
- );
- }
+ resultobj = PyList_New((*arg6)->count);
+ for (i6 = 0; i6 < (*arg6)->count; i6++) {
+ PyList_SetItem(resultobj, i6,
+ SWIG_NewPointerObj((*arg6)->msgs[i6], SWIGTYPE_p_ldb_message, 0)
+ );
}
talloc_free(arg2);
if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
- {
- talloc_free(arg5);
- }
+ talloc_free(arg5);
return resultobj;
fail:
talloc_free(arg2);
if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
- {
- talloc_free(arg5);
- }
+ talloc_free(arg5);
return NULL;
}
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Ldb_set_debug" "', argument " "1"" of type '" "ldb *""'");
}
arg1 = (ldb *)(argp1);
- {
- arg2 = py_ldb_debug;
- /* FIXME: Should be decreased somewhere as well. Perhaps register a
- destructor and tie it to the ldb context ? */
- Py_INCREF(obj1);
- arg3 = obj1;
- }
+ arg2 = py_ldb_debug;
+ /* FIXME: Should be decreased somewhere as well. Perhaps register a
+ destructor and tie it to the ldb context ? */
+ Py_INCREF(obj1);
+ arg3 = obj1;
if (arg1 == NULL)
SWIG_exception(SWIG_ValueError,
"ldb context must be non-NULL");
(char *) "self",(char *) "dn", NULL
};
- {
- arg3 = &tmp3;
- }
+ arg3 = &tmp3;
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Ldb___contains__",kwnames,&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ldb_context, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_fail;
}
resultobj = Py_None;
- {
- resultobj = ((*arg3)->count > 0)?Py_True:Py_False;
- }
+ resultobj = ((*arg3)->count > 0)?Py_True:Py_False;
talloc_free(arg2);
- {
- talloc_free(*arg3);
- }
+ talloc_free(*arg3);
return resultobj;
fail:
talloc_free(arg2);
- {
- talloc_free(*arg3);
- }
+ talloc_free(*arg3);
return NULL;
}
};
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:register_module",kwnames,&obj0)) SWIG_fail;
- {
- arg1 = talloc_zero(talloc_autofree_context(), struct ldb_module_ops);
-
- arg1->name = (char *)PyObject_GetAttrString(obj0, (char *)"name");
- }
+ arg1 = talloc_zero(talloc_autofree_context(), struct ldb_module_ops);
+
+ arg1->name = (char *)PyObject_GetAttrString(obj0, (char *)"name");
result = ldb_register_module((struct ldb_module_ops const *)arg1);
if (result != 0) {
PyErr_SetObject(PyExc_LdbError, Py_BuildValue((char *)"(i,s)", result, ldb_strerror(result)));