summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-08-01 22:46:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:15:19 -0500
commitf685635e87923807c9fde843f57c02ded16caf09 (patch)
tree87b165e8af409ba388c7c20c0448bcbbd564bdba /source4
parent529c5dae51c1e782e095bf96b7ab2ca95ccbb856 (diff)
downloadsamba-f685635e87923807c9fde843f57c02ded16caf09.tar.gz
samba-f685635e87923807c9fde843f57c02ded16caf09.tar.bz2
samba-f685635e87923807c9fde843f57c02ded16caf09.zip
r17368: Add 'const' to ldb_match_msg().
Andrew Bartlett (This used to be commit 54eda4b85975c44c993a7dc45f6caa898076f163)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb/common/ldb_match.c40
-rw-r--r--source4/lib/ldb/include/ldb_private.h4
2 files changed, 22 insertions, 22 deletions
diff --git a/source4/lib/ldb/common/ldb_match.c b/source4/lib/ldb/common/ldb_match.c
index f3ecbe0381..64e52d285d 100644
--- a/source4/lib/ldb/common/ldb_match.c
+++ b/source4/lib/ldb/common/ldb_match.c
@@ -81,9 +81,9 @@ static int ldb_match_scope(struct ldb_context *ldb,
match if node is present
*/
static int ldb_match_present(struct ldb_context *ldb,
- struct ldb_message *msg,
- struct ldb_parse_tree *tree,
- enum ldb_scope scope)
+ const struct ldb_message *msg,
+ const struct ldb_parse_tree *tree,
+ enum ldb_scope scope)
{
if (ldb_attr_dn(tree->u.present.attr) == 0) {
return 1;
@@ -97,8 +97,8 @@ static int ldb_match_present(struct ldb_context *ldb,
}
static int ldb_match_comparison(struct ldb_context *ldb,
- struct ldb_message *msg,
- struct ldb_parse_tree *tree,
+ const struct ldb_message *msg,
+ const struct ldb_parse_tree *tree,
enum ldb_scope scope,
enum ldb_parse_op comp_op)
{
@@ -138,8 +138,8 @@ static int ldb_match_comparison(struct ldb_context *ldb,
match a simple leaf node
*/
static int ldb_match_equality(struct ldb_context *ldb,
- struct ldb_message *msg,
- struct ldb_parse_tree *tree,
+ const struct ldb_message *msg,
+ const struct ldb_parse_tree *tree,
enum ldb_scope scope)
{
unsigned int i;
@@ -183,7 +183,7 @@ static int ldb_match_equality(struct ldb_context *ldb,
}
static int ldb_wildcard_compare(struct ldb_context *ldb,
- struct ldb_parse_tree *tree,
+ const struct ldb_parse_tree *tree,
const struct ldb_val value)
{
const struct ldb_attrib_handler *h;
@@ -254,8 +254,8 @@ failed:
match a simple leaf node
*/
static int ldb_match_substring(struct ldb_context *ldb,
- struct ldb_message *msg,
- struct ldb_parse_tree *tree,
+ const struct ldb_message *msg,
+ const struct ldb_parse_tree *tree,
enum ldb_scope scope)
{
unsigned int i;
@@ -279,7 +279,7 @@ static int ldb_match_substring(struct ldb_context *ldb,
/*
bitwise-and comparator
*/
-static int ldb_comparator_and(struct ldb_val *v1, struct ldb_val *v2)
+static int ldb_comparator_and(const struct ldb_val *v1, const struct ldb_val *v2)
{
uint64_t i1, i2;
i1 = strtoull((char *)v1->data, NULL, 0);
@@ -290,7 +290,7 @@ static int ldb_comparator_and(struct ldb_val *v1, struct ldb_val *v2)
/*
bitwise-or comparator
*/
-static int ldb_comparator_or(struct ldb_val *v1, struct ldb_val *v2)
+static int ldb_comparator_or(const struct ldb_val *v1, const struct ldb_val *v2)
{
uint64_t i1, i2;
i1 = strtoull((char *)v1->data, NULL, 0);
@@ -303,19 +303,19 @@ static int ldb_comparator_or(struct ldb_val *v1, struct ldb_val *v2)
extended match, handles things like bitops
*/
static int ldb_match_extended(struct ldb_context *ldb,
- struct ldb_message *msg,
- struct ldb_parse_tree *tree,
+ const struct ldb_message *msg,
+ const struct ldb_parse_tree *tree,
enum ldb_scope scope)
{
int i;
const struct {
const char *oid;
- int (*comparator)(struct ldb_val *, struct ldb_val *);
+ int (*comparator)(const struct ldb_val *, const struct ldb_val *);
} rules[] = {
{ LDB_OID_COMPARATOR_AND, ldb_comparator_and},
{ LDB_OID_COMPARATOR_OR, ldb_comparator_or}
};
- int (*comp)(struct ldb_val *, struct ldb_val *) = NULL;
+ int (*comp)(const struct ldb_val *, const struct ldb_val *) = NULL;
struct ldb_message_element *el;
if (tree->u.extended.dnAttributes) {
@@ -366,8 +366,8 @@ static int ldb_match_extended(struct ldb_context *ldb,
this is a recursive function, and does short-circuit evaluation
*/
static int ldb_match_message(struct ldb_context *ldb,
- struct ldb_message *msg,
- struct ldb_parse_tree *tree,
+ const struct ldb_message *msg,
+ const struct ldb_parse_tree *tree,
enum ldb_scope scope)
{
unsigned int i;
@@ -418,8 +418,8 @@ static int ldb_match_message(struct ldb_context *ldb,
}
int ldb_match_msg(struct ldb_context *ldb,
- struct ldb_message *msg,
- struct ldb_parse_tree *tree,
+ const struct ldb_message *msg,
+ const struct ldb_parse_tree *tree,
const struct ldb_dn *base,
enum ldb_scope scope)
{
diff --git a/source4/lib/ldb/include/ldb_private.h b/source4/lib/ldb/include/ldb_private.h
index b862daec86..f442202ee3 100644
--- a/source4/lib/ldb/include/ldb_private.h
+++ b/source4/lib/ldb/include/ldb_private.h
@@ -171,8 +171,8 @@ int ldb_tdb_init(void);
int ldb_sqlite3_init(void);
int ldb_match_msg(struct ldb_context *ldb,
- struct ldb_message *msg,
- struct ldb_parse_tree *tree,
+ const struct ldb_message *msg,
+ const struct ldb_parse_tree *tree,
const struct ldb_dn *base,
enum ldb_scope scope);