summaryrefslogtreecommitdiff
path: root/lib/ldb
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2018-04-27 13:15:01 +1200
committerDouglas Bagnall <dbagnall@samba.org>2019-07-10 04:32:13 +0000
commit1d6b472cdcddbd6892741a381f33faf0b4ddc847 (patch)
treebf8a05174b4afbc15d5165daaaef6d611a13094f /lib/ldb
parent339f8bbdda04a23460e7fa908d60857b95271c6e (diff)
downloadsamba-1d6b472cdcddbd6892741a381f33faf0b4ddc847.tar.gz
pyldb: rename pyldb_Dn_AsDn() to pyldb_Dn_AS_DN()
Following the python/C convention for checking vs non-checking convertors. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'lib/ldb')
-rw-r--r--lib/ldb/pyldb.c34
-rw-r--r--lib/ldb/pyldb.h2
-rw-r--r--lib/ldb/pyldb_util.c2
3 files changed, 19 insertions, 19 deletions
diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c
index dac539b1ef9..77d34d63987 100644
--- a/lib/ldb/pyldb.c
+++ b/lib/ldb/pyldb.c
@@ -603,14 +603,14 @@ static PyObject *py_ldb_dn_richcmp(PyObject *dn1, PyObject *dn2, int op)
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
}
- ret = ldb_dn_compare(pyldb_Dn_AsDn(dn1), pyldb_Dn_AsDn(dn2));
+ ret = ldb_dn_compare(pyldb_Dn_AS_DN(dn1), pyldb_Dn_AS_DN(dn2));
return richcmp(ret, op);
}
static PyObject *py_ldb_dn_get_parent(PyLdbDnObject *self,
PyObject *Py_UNUSED(ignored))
{
- struct ldb_dn *dn = pyldb_Dn_AsDn((PyObject *)self);
+ struct ldb_dn *dn = pyldb_Dn_AS_DN((PyObject *)self);
struct ldb_dn *parent;
PyLdbDnObject *py_ret;
TALLOC_CTX *mem_ctx = talloc_new(NULL);
@@ -639,7 +639,7 @@ static PyObject *py_ldb_dn_add_child(PyLdbDnObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O", &py_other))
return NULL;
- dn = pyldb_Dn_AsDn((PyObject *)self);
+ dn = pyldb_Dn_AS_DN((PyObject *)self);
if (!pyldb_Object_AsDn(NULL, py_other, ldb_dn_get_ldb_context(dn), &other))
return NULL;
@@ -654,7 +654,7 @@ static PyObject *py_ldb_dn_add_base(PyLdbDnObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O", &py_other))
return NULL;
- dn = pyldb_Dn_AsDn((PyObject *)self);
+ dn = pyldb_Dn_AS_DN((PyObject *)self);
if (!pyldb_Object_AsDn(NULL, py_other, ldb_dn_get_ldb_context(dn), &other))
return NULL;
@@ -669,7 +669,7 @@ static PyObject *py_ldb_dn_remove_base_components(PyLdbDnObject *self, PyObject
if (!PyArg_ParseTuple(args, "i", &i))
return NULL;
- dn = pyldb_Dn_AsDn((PyObject *)self);
+ dn = pyldb_Dn_AS_DN((PyObject *)self);
return PyBool_FromLong(ldb_dn_remove_base_components(dn, i));
}
@@ -681,7 +681,7 @@ static PyObject *py_ldb_dn_is_child_of(PyLdbDnObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O", &py_base))
return NULL;
- dn = pyldb_Dn_AsDn((PyObject *)self);
+ dn = pyldb_Dn_AS_DN((PyObject *)self);
if (!pyldb_Object_AsDn(NULL, py_base, ldb_dn_get_ldb_context(dn), &base))
return NULL;
@@ -698,7 +698,7 @@ static PyObject *py_ldb_dn_get_component_name(PyLdbDnObject *self, PyObject *arg
if (!PyArg_ParseTuple(args, "I", &num))
return NULL;
- dn = pyldb_Dn_AsDn((PyObject *)self);
+ dn = pyldb_Dn_AS_DN((PyObject *)self);
name = ldb_dn_get_component_name(dn, num);
if (name == NULL) {
@@ -717,7 +717,7 @@ static PyObject *py_ldb_dn_get_component_value(PyLdbDnObject *self, PyObject *ar
if (!PyArg_ParseTuple(args, "I", &num))
return NULL;
- dn = pyldb_Dn_AsDn((PyObject *)self);
+ dn = pyldb_Dn_AS_DN((PyObject *)self);
val = ldb_dn_get_component_val(dn, num);
if (val == NULL) {
@@ -756,7 +756,7 @@ static PyObject *py_ldb_dn_get_rdn_name(PyLdbDnObject *self,
struct ldb_dn *dn;
const char *name;
- dn = pyldb_Dn_AsDn((PyObject *)self);
+ dn = pyldb_Dn_AS_DN((PyObject *)self);
name = ldb_dn_get_rdn_name(dn);
if (name == NULL) {
@@ -772,7 +772,7 @@ static PyObject *py_ldb_dn_get_rdn_value(PyLdbDnObject *self,
struct ldb_dn *dn;
const struct ldb_val *val;
- dn = pyldb_Dn_AsDn((PyObject *)self);
+ dn = pyldb_Dn_AS_DN((PyObject *)self);
val = ldb_dn_get_rdn_val(dn);
if (val == NULL) {
@@ -853,7 +853,7 @@ static PyMethodDef py_ldb_dn_methods[] = {
static Py_ssize_t py_ldb_dn_len(PyLdbDnObject *self)
{
- return ldb_dn_get_comp_num(pyldb_Dn_AsDn((PyObject *)self));
+ return ldb_dn_get_comp_num(pyldb_Dn_AS_DN((PyObject *)self));
}
/*
@@ -875,7 +875,7 @@ static PyObject *py_ldb_dn_copy(struct ldb_dn *dn)
static PyObject *py_ldb_dn_concat(PyLdbDnObject *self, PyObject *py_other)
{
- struct ldb_dn *dn = pyldb_Dn_AsDn((PyObject *)self),
+ struct ldb_dn *dn = pyldb_Dn_AS_DN((PyObject *)self),
*other;
PyLdbDnObject *py_ret;
@@ -2803,7 +2803,7 @@ static PyObject *py_ldb_module_search(PyLdbModuleObject *self, PyObject *args, P
return NULL;
}
- ret = ldb_build_search_req(&req, mod->ldb, NULL, pyldb_Dn_AsDn(py_base),
+ ret = ldb_build_search_req(&req, mod->ldb, NULL, pyldb_Dn_AS_DN(py_base),
scope, NULL /* expr */, attrs,
NULL /* controls */, NULL, NULL, NULL);
@@ -2880,7 +2880,7 @@ static PyObject *py_ldb_module_delete(PyLdbModuleObject *self, PyObject *args)
req = talloc_zero(NULL, struct ldb_request);
req->operation = LDB_DELETE;
- req->op.del.dn = pyldb_Dn_AsDn(py_dn);
+ req->op.del.dn = pyldb_Dn_AS_DN(py_dn);
ret = pyldb_Module_AsModule(self)->ops->del(pyldb_Module_AsModule(self), req);
@@ -2901,8 +2901,8 @@ static PyObject *py_ldb_module_rename(PyLdbModuleObject *self, PyObject *args)
req = talloc_zero(NULL, struct ldb_request);
req->operation = LDB_RENAME;
- req->op.rename.olddn = pyldb_Dn_AsDn(py_dn1);
- req->op.rename.newdn = pyldb_Dn_AsDn(py_dn2);
+ req->op.rename.olddn = pyldb_Dn_AS_DN(py_dn1);
+ req->op.rename.newdn = pyldb_Dn_AS_DN(py_dn2);
ret = pyldb_Module_AsModule(self)->ops->rename(pyldb_Module_AsModule(self), req);
@@ -3733,7 +3733,7 @@ static int py_ldb_msg_set_dn(PyLdbMessageObject *self, PyObject *value, void *cl
return -1;
}
- msg->dn = talloc_reference(msg, pyldb_Dn_AsDn(value));
+ msg->dn = talloc_reference(msg, pyldb_Dn_AS_DN(value));
return 0;
}
diff --git a/lib/ldb/pyldb.h b/lib/ldb/pyldb.h
index 56e0f5e19c0..2d354422cdb 100644
--- a/lib/ldb/pyldb.h
+++ b/lib/ldb/pyldb.h
@@ -50,7 +50,7 @@ typedef struct {
PyObject *pyldb_Dn_FromDn(struct ldb_dn *);
bool pyldb_Object_AsDn(TALLOC_CTX *mem_ctx, PyObject *object, struct ldb_context *ldb_ctx, struct ldb_dn **dn);
-#define pyldb_Dn_AsDn(pyobj) ((PyLdbDnObject *)pyobj)->dn
+#define pyldb_Dn_AS_DN(pyobj) ((PyLdbDnObject *)pyobj)->dn
bool pyldb_check_type(PyObject *obj, const char *type_name);
diff --git a/lib/ldb/pyldb_util.c b/lib/ldb/pyldb_util.c
index 811511547ed..665e34426bc 100644
--- a/lib/ldb/pyldb_util.c
+++ b/lib/ldb/pyldb_util.c
@@ -109,7 +109,7 @@ bool pyldb_Object_AsDn(TALLOC_CTX *mem_ctx, PyObject *object,
}
if (PyObject_TypeCheck(object, PyLdb_Dn_Type)) {
- *dn = pyldb_Dn_AsDn(object);
+ *dn = pyldb_Dn_AS_DN(object);
return true;
}