diff options
author | Simo Sorce <idra@samba.org> | 2006-08-13 08:00:36 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:15:31 -0500 |
commit | a23b63a8e54db7d0ec98ad95cdca11dd4d039e17 (patch) | |
tree | b5a38a7ca5dd1347097fe14b9f80df25fa3e4594 /source4/lib/ldb | |
parent | 8492a45f8a936943c9ddd0fd400871b78308a23d (diff) | |
download | samba-a23b63a8e54db7d0ec98ad95cdca11dd4d039e17.tar.gz samba-a23b63a8e54db7d0ec98ad95cdca11dd4d039e17.tar.bz2 samba-a23b63a8e54db7d0ec98ad95cdca11dd4d039e17.zip |
r17516: Change helper function names to make more clear what they are meant to do
(This used to be commit ad75cf869550af66119d0293503024d41d834e02)
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r-- | source4/lib/ldb/common/ldb_msg.c | 42 | ||||
-rw-r--r-- | source4/lib/ldb/include/ldb.h | 42 | ||||
-rw-r--r-- | source4/lib/ldb/ldb_ildap/ldb_ildap.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_cache.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_tdb.c | 2 |
5 files changed, 45 insertions, 45 deletions
diff --git a/source4/lib/ldb/common/ldb_msg.c b/source4/lib/ldb/common/ldb_msg.c index b0dc74bdb5..2cbfc2467a 100644 --- a/source4/lib/ldb/common/ldb_msg.c +++ b/source4/lib/ldb/common/ldb_msg.c @@ -311,9 +311,9 @@ const struct ldb_val *ldb_msg_find_ldb_val(const struct ldb_message *msg, const return &el->values[0]; } -int ldb_msg_find_int(const struct ldb_message *msg, - const char *attr_name, - int default_value) +int ldb_msg_find_attr_as_int(const struct ldb_message *msg, + const char *attr_name, + int default_value) { const struct ldb_val *v = ldb_msg_find_ldb_val(msg, attr_name); if (!v || !v->data) { @@ -322,9 +322,9 @@ int ldb_msg_find_int(const struct ldb_message *msg, return strtol((const char *)v->data, NULL, 0); } -unsigned int ldb_msg_find_uint(const struct ldb_message *msg, - const char *attr_name, - unsigned int default_value) +unsigned int ldb_msg_find_attr_as_uint(const struct ldb_message *msg, + const char *attr_name, + unsigned int default_value) { const struct ldb_val *v = ldb_msg_find_ldb_val(msg, attr_name); if (!v || !v->data) { @@ -333,9 +333,9 @@ unsigned int ldb_msg_find_uint(const struct ldb_message *msg, return strtoul((const char *)v->data, NULL, 0); } -int64_t ldb_msg_find_int64(const struct ldb_message *msg, - const char *attr_name, - int64_t default_value) +int64_t ldb_msg_find_attr_as_int64(const struct ldb_message *msg, + const char *attr_name, + int64_t default_value) { const struct ldb_val *v = ldb_msg_find_ldb_val(msg, attr_name); if (!v || !v->data) { @@ -344,9 +344,9 @@ int64_t ldb_msg_find_int64(const struct ldb_message *msg, return strtoll((const char *)v->data, NULL, 0); } -uint64_t ldb_msg_find_uint64(const struct ldb_message *msg, - const char *attr_name, - uint64_t default_value) +uint64_t ldb_msg_find_attr_as_uint64(const struct ldb_message *msg, + const char *attr_name, + uint64_t default_value) { const struct ldb_val *v = ldb_msg_find_ldb_val(msg, attr_name); if (!v || !v->data) { @@ -355,9 +355,9 @@ uint64_t ldb_msg_find_uint64(const struct ldb_message *msg, return strtoull((const char *)v->data, NULL, 0); } -double ldb_msg_find_double(const struct ldb_message *msg, - const char *attr_name, - double default_value) +double ldb_msg_find_attr_as_double(const struct ldb_message *msg, + const char *attr_name, + double default_value) { const struct ldb_val *v = ldb_msg_find_ldb_val(msg, attr_name); if (!v || !v->data) { @@ -366,9 +366,9 @@ double ldb_msg_find_double(const struct ldb_message *msg, return strtod((const char *)v->data, NULL); } -const char *ldb_msg_find_string(const struct ldb_message *msg, - const char *attr_name, - const char *default_value) +const char *ldb_msg_find_attr_as_string(const struct ldb_message *msg, + const char *attr_name, + const char *default_value) { const struct ldb_val *v = ldb_msg_find_ldb_val(msg, attr_name); if (!v || !v->data) { @@ -377,9 +377,9 @@ const char *ldb_msg_find_string(const struct ldb_message *msg, return (const char *)v->data; } -struct ldb_dn *ldb_msg_find_dn(void *mem_ctx, - const struct ldb_message *msg, - const char *attr_name) +struct ldb_dn *ldb_msg_find_attr_as_dn(void *mem_ctx, + const struct ldb_message *msg, + const char *attr_name) { const struct ldb_val *v; diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h index e560068d0c..e756a9b00b 100644 --- a/source4/lib/ldb/include/ldb.h +++ b/source4/lib/ldb/include/ldb.h @@ -1250,28 +1250,28 @@ int ldb_msg_element_compare(struct ldb_message_element *el1, single valued. */ const struct ldb_val *ldb_msg_find_ldb_val(const struct ldb_message *msg, const char *attr_name); -int ldb_msg_find_int(const struct ldb_message *msg, - const char *attr_name, - int default_value); -unsigned int ldb_msg_find_uint(const struct ldb_message *msg, - const char *attr_name, - unsigned int default_value); -int64_t ldb_msg_find_int64(const struct ldb_message *msg, - const char *attr_name, - int64_t default_value); -uint64_t ldb_msg_find_uint64(const struct ldb_message *msg, +int ldb_msg_find_attr_as_int(const struct ldb_message *msg, const char *attr_name, - uint64_t default_value); -double ldb_msg_find_double(const struct ldb_message *msg, - const char *attr_name, - double default_value); -const char *ldb_msg_find_string(const struct ldb_message *msg, - const char *attr_name, - const char *default_value); - -struct ldb_dn *ldb_msg_find_dn(void *mem_ctx, - const struct ldb_message *msg, - const char *attr_name); + int default_value); +unsigned int ldb_msg_find_attr_as_uint(const struct ldb_message *msg, + const char *attr_name, + unsigned int default_value); +int64_t ldb_msg_find_attr_as_int64(const struct ldb_message *msg, + const char *attr_name, + int64_t default_value); +uint64_t ldb_msg_find_attr_as_uint64(const struct ldb_message *msg, + const char *attr_name, + uint64_t default_value); +double ldb_msg_find_attr_as_double(const struct ldb_message *msg, + const char *attr_name, + double default_value); +const char *ldb_msg_find_attr_as_string(const struct ldb_message *msg, + const char *attr_name, + const char *default_value); + +struct ldb_dn *ldb_msg_find_attr_as_dn(void *mem_ctx, + const struct ldb_message *msg, + const char *attr_name); void ldb_msg_sort_elements(struct ldb_message *msg); diff --git a/source4/lib/ldb/ldb_ildap/ldb_ildap.c b/source4/lib/ldb/ldb_ildap/ldb_ildap.c index c71f1be9ba..99e3f3e322 100644 --- a/source4/lib/ldb/ldb_ildap/ldb_ildap.c +++ b/source4/lib/ldb/ldb_ildap/ldb_ildap.c @@ -455,7 +455,7 @@ static int ildb_search(struct ldb_module *module, struct ldb_request *req) if (req->op.search.base == NULL) { if (ildb->rootDSE != NULL) { msg->r.SearchRequest.basedn = - talloc_strdup(msg, ldb_msg_find_string(ildb->rootDSE, "defaultNamingContext", "")); + talloc_strdup(msg, ldb_msg_find_attr_as_string(ildb->rootDSE, "defaultNamingContext", "")); } else { msg->r.SearchRequest.basedn = talloc_strdup(msg, ""); } diff --git a/source4/lib/ldb/ldb_tdb/ldb_cache.c b/source4/lib/ldb/ldb_tdb/ldb_cache.c index cfbe7b2ab3..5634e9ad16 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_cache.c +++ b/source4/lib/ldb/ldb_tdb/ldb_cache.c @@ -356,7 +356,7 @@ int ltdb_cache_load(struct ldb_module *module) /* if the current internal sequence number is the same as the one in the database then assume the rest of the cache is OK */ - seq = ldb_msg_find_double(ltdb->cache->baseinfo, LTDB_SEQUENCE_NUMBER, 0); + seq = ldb_msg_find_attr_as_double(ltdb->cache->baseinfo, LTDB_SEQUENCE_NUMBER, 0); if (seq == ltdb->sequence_number) { goto done; } diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c index 8f8cb68d98..97b03a9410 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c +++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c @@ -953,7 +953,7 @@ static int ltdb_sequence_number(struct ldb_module *module, struct ldb_request *r return LDB_SUCCESS; } - req->op.seq_num.seq_num = ldb_msg_find_uint64(msg, LTDB_SEQUENCE_NUMBER, 0); + req->op.seq_num.seq_num = ldb_msg_find_attr_as_uint64(msg, LTDB_SEQUENCE_NUMBER, 0); talloc_free(tmp_ctx); return LDB_SUCCESS; } |