return NULL;
}
- ldb_ctx = pyldb_Ldb_AsLdbContext(py_ldb);
+ ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(py_ldb);
parsed_controls = ldb_parse_control_from_string(ldb_ctx, mem_ctx, data);
if (!parsed_controls) {
PyErr_SetString(PyExc_TypeError, "Expected Ldb");
goto out;
}
-
- ldb_ctx = pyldb_Ldb_AsLdbContext(py_ldb);
+ ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(py_ldb);
mem_ctx = talloc_new(NULL);
if (mem_ctx == NULL) {
Py_INCREF(cb);
/* FIXME: DECREF cb when exiting program */
py_ldb_debug_func = cb;
- ldb_ctx = pyldb_Ldb_AsLdbContext(self);
+ ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(self);
PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError,
ldb_set_debug(ldb_ctx, py_ldb_debug, cb),
ldb_ctx);
if (!PyArg_ParseTuple(args, "I", &perms))
return NULL;
- ldb_set_create_perms(pyldb_Ldb_AsLdbContext(self), perms);
+ ldb_set_create_perms(pyldb_Ldb_AS_LDBCONTEXT(self), perms);
Py_RETURN_NONE;
}
if (!PyArg_ParseTuple(args, "s", &modules_dir))
return NULL;
- ldb_set_modules_dir(pyldb_Ldb_AsLdbContext(self), modules_dir);
+ ldb_set_modules_dir(pyldb_Ldb_AS_LDBCONTEXT(self), modules_dir);
Py_RETURN_NONE;
}
static PyObject *py_ldb_transaction_start(PyLdbObject *self,
PyObject *Py_UNUSED(ignored))
{
- struct ldb_context *ldb_ctx = pyldb_Ldb_AsLdbContext(self);
+ struct ldb_context *ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(self);
int ldb_err;
ldb_err = ldb_transaction_start(ldb_ctx);
PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_err, ldb_ctx);
static PyObject *py_ldb_transaction_commit(PyLdbObject *self,
PyObject *Py_UNUSED(ignored))
{
- struct ldb_context *ldb_ctx = pyldb_Ldb_AsLdbContext(self);
+ struct ldb_context *ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(self);
int ldb_err;
ldb_err = ldb_transaction_commit(ldb_ctx);
PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_err, ldb_ctx);
static PyObject *py_ldb_transaction_prepare_commit(PyLdbObject *self,
PyObject *Py_UNUSED(ignored))
{
- struct ldb_context *ldb_ctx = pyldb_Ldb_AsLdbContext(self);
+ struct ldb_context *ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(self);
int ldb_err;
ldb_err = ldb_transaction_prepare_commit(ldb_ctx);
PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_err, ldb_ctx);
static PyObject *py_ldb_transaction_cancel(PyLdbObject *self,
PyObject *Py_UNUSED(ignored))
{
- struct ldb_context *ldb_ctx = pyldb_Ldb_AsLdbContext(self);
+ struct ldb_context *ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(self);
int ldb_err;
ldb_err = ldb_transaction_cancel(ldb_ctx);
PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_err, ldb_ctx);
static PyObject *py_ldb_setup_wellknown_attributes(PyLdbObject *self,
PyObject *Py_UNUSED(ignored))
{
- struct ldb_context *ldb_ctx = pyldb_Ldb_AsLdbContext(self);
+ struct ldb_context *ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(self);
int ldb_err;
ldb_err = ldb_setup_wellknown_attributes(ldb_ctx);
PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_err, ldb_ctx);
static PyObject *py_ldb_get_root_basedn(PyLdbObject *self,
PyObject *Py_UNUSED(ignored))
{
- struct ldb_dn *dn = ldb_get_root_basedn(pyldb_Ldb_AsLdbContext(self));
+ struct ldb_dn *dn = ldb_get_root_basedn(pyldb_Ldb_AS_LDBCONTEXT(self));
if (dn == NULL)
Py_RETURN_NONE;
return py_ldb_dn_copy(dn);
static PyObject *py_ldb_get_schema_basedn(PyLdbObject *self,
PyObject *Py_UNUSED(ignored))
{
- struct ldb_dn *dn = ldb_get_schema_basedn(pyldb_Ldb_AsLdbContext(self));
+ struct ldb_dn *dn = ldb_get_schema_basedn(pyldb_Ldb_AS_LDBCONTEXT(self));
if (dn == NULL)
Py_RETURN_NONE;
return py_ldb_dn_copy(dn);
static PyObject *py_ldb_get_config_basedn(PyLdbObject *self,
PyObject *Py_UNUSED(ignored))
{
- struct ldb_dn *dn = ldb_get_config_basedn(pyldb_Ldb_AsLdbContext(self));
+ struct ldb_dn *dn = ldb_get_config_basedn(pyldb_Ldb_AS_LDBCONTEXT(self));
if (dn == NULL)
Py_RETURN_NONE;
return py_ldb_dn_copy(dn);
static PyObject *py_ldb_get_default_basedn(PyLdbObject *self,
PyObject *Py_UNUSED(ignored))
{
- struct ldb_dn *dn = ldb_get_default_basedn(pyldb_Ldb_AsLdbContext(self));
+ struct ldb_dn *dn = ldb_get_default_basedn(pyldb_Ldb_AS_LDBCONTEXT(self));
if (dn == NULL)
Py_RETURN_NONE;
return py_ldb_dn_copy(dn);
&url, &flags, &py_options))
return -1;
- ldb = pyldb_Ldb_AsLdbContext(self);
+ ldb = pyldb_Ldb_AS_LDBCONTEXT(self);
if (py_options == Py_None) {
options = NULL;
return NULL;
}
- ldb_ctx = pyldb_Ldb_AsLdbContext(self);
+ ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(self);
ret = ldb_connect(ldb_ctx, url, flags, options);
talloc_free(options);
PyErr_NoMemory();
return NULL;
}
- ldb_ctx = pyldb_Ldb_AsLdbContext(self);
+ ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(self);
if (py_controls == Py_None) {
parsed_controls = NULL;
PyErr_NoMemory();
return NULL;
}
- ldb_ctx = pyldb_Ldb_AsLdbContext(self);
+ ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(self);
if (py_controls == Py_None) {
parsed_controls = NULL;
PyErr_NoMemory();
return NULL;
}
- ldb_ctx = pyldb_Ldb_AsLdbContext(self);
+ ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(self);
if (py_controls == Py_None) {
parsed_controls = NULL;
struct ldb_request *req;
const char * const kwnames[] = { "dn1", "dn2", "controls", NULL };
- ldb_ctx = pyldb_Ldb_AsLdbContext(self);
+ ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(self);
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|O",
discard_const_p(char *, kwnames),
if (!PyArg_ParseTuple(args, "s", &name))
return NULL;
- ldb_schema_attribute_remove(pyldb_Ldb_AsLdbContext(self), name);
+ ldb_schema_attribute_remove(pyldb_Ldb_AS_LDBCONTEXT(self), name);
Py_RETURN_NONE;
}
if (!PyArg_ParseTuple(args, "sIs", &attribute, &flags, &syntax))
return NULL;
- ldb_ctx = pyldb_Ldb_AsLdbContext(self);
+ ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(self);
ret = ldb_schema_attribute_add(ldb_ctx, attribute, flags, syntax);
PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, ldb_ctx);
mem_ctx = talloc_new(NULL);
- string = ldb_ldif_write_string(pyldb_Ldb_AsLdbContext(self), mem_ctx, &ldif);
+ string = ldb_ldif_write_string(pyldb_Ldb_AS_LDBCONTEXT(self), mem_ctx, &ldif);
if (!string) {
PyErr_SetString(PyExc_KeyError, "Failed to generate LDIF");
return NULL;
return NULL;
}
- ldb = pyldb_Ldb_AsLdbContext(self);
+ ldb = pyldb_Ldb_AS_LDBCONTEXT(self);
ldb_ret = ldb_msg_difference(ldb, ldb,
pyldb_Message_AsMessage(py_msg_old),
pyldb_Message_AsMessage(py_msg_new),
return NULL;
}
- a = ldb_schema_attribute_by_name(pyldb_Ldb_AsLdbContext(self), element_name);
+ a = ldb_schema_attribute_by_name(pyldb_Ldb_AS_LDBCONTEXT(self), element_name);
if (a == NULL) {
Py_RETURN_NONE;
return NULL;
}
- if (a->syntax->ldif_write_fn(pyldb_Ldb_AsLdbContext(self), mem_ctx, &old_val, &new_val) != 0) {
+ if (a->syntax->ldif_write_fn(pyldb_Ldb_AS_LDBCONTEXT(self), mem_ctx, &old_val, &new_val) != 0) {
talloc_free(mem_ctx);
Py_RETURN_NONE;
}
PyErr_NoMemory();
return NULL;
}
- ldb_ctx = pyldb_Ldb_AsLdbContext(self);
+ ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(self);
if (py_attrs == Py_None) {
attrs = NULL;
return NULL;
}
- ldb_ctx = pyldb_Ldb_AsLdbContext(self);
+ ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(self);
if (py_attrs == Py_None) {
attrs = NULL;
if (!PyArg_ParseTuple(args, "s", &name))
return NULL;
- data = ldb_get_opaque(pyldb_Ldb_AsLdbContext(self), name);
+ data = ldb_get_opaque(pyldb_Ldb_AS_LDBCONTEXT(self), name);
if (data == NULL)
Py_RETURN_NONE;
/* FIXME: More interpretation */
- ldb_set_opaque(pyldb_Ldb_AsLdbContext(self), name, data);
+ ldb_set_opaque(pyldb_Ldb_AS_LDBCONTEXT(self), name, data);
Py_RETURN_NONE;
}
static PyObject *py_ldb_modules(PyLdbObject *self,
PyObject *Py_UNUSED(ignored))
{
- struct ldb_context *ldb = pyldb_Ldb_AsLdbContext(self);
+ struct ldb_context *ldb = pyldb_Ldb_AS_LDBCONTEXT(self);
PyObject *ret = PyList_New(0);
struct ldb_module *mod;
static PyObject *py_ldb_sequence_number(PyLdbObject *self, PyObject *args)
{
- struct ldb_context *ldb = pyldb_Ldb_AsLdbContext(self);
+ struct ldb_context *ldb = pyldb_Ldb_AS_LDBCONTEXT(self);
int type, ret;
uint64_t value;
static PyObject *py_ldb_register_test_extensions(PyLdbObject *self,
PyObject *Py_UNUSED(ignored))
{
- struct ldb_context *ldb = pyldb_Ldb_AsLdbContext(self);
+ struct ldb_context *ldb = pyldb_Ldb_AS_LDBCONTEXT(self);
int ret;
ret = ldb_dn_extended_add_syntax(ldb, LDB_ATTR_FLAG_FIXED, &test_dn_syntax);
static PyObject *py_ldb_get_firstmodule(PyLdbObject *self, void *closure)
{
- struct ldb_module *mod = pyldb_Ldb_AsLdbContext(self)->modules;
+ struct ldb_module *mod = pyldb_Ldb_AS_LDBCONTEXT(self)->modules;
if (mod == NULL) {
Py_RETURN_NONE;
}
static int py_ldb_contains(PyLdbObject *self, PyObject *obj)
{
- struct ldb_context *ldb_ctx = pyldb_Ldb_AsLdbContext(self);
+ struct ldb_context *ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(self);
struct ldb_dn *dn;
struct ldb_result *result;
unsigned int count;
if (ret != LDB_SUCCESS) {
struct ldb_context *ldb_ctx;
TALLOC_FREE(self->state.req);
- ldb_ctx = pyldb_Ldb_AsLdbContext(self->ldb);
+ ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(self->ldb);
/*
* We stop the iteration and let
* py_ldb_search_iterator_result() will deliver
return NULL;
}
- ldb_ctx = pyldb_Ldb_AsLdbContext(py_ldb);
+ ldb_ctx = pyldb_Ldb_AS_LDBCONTEXT(py_ldb);
msg = PyDict_AsMessage(ldb_ctx, py_dict, ldb_ctx, mod_flags);
if (!msg) {