>From e6709b54aae7cde6a3d6c73c756cb220a8129e2a Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Tue, 21 Aug 2012 12:33:15 +0200 Subject: [PATCH] SYSDB: Make sysdb_attrs_get_el_int() public Also rename it to sysdb_attrs_get_el_ext() --- src/db/sysdb.c | 16 ++++++++-------- src/db/sysdb.h | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/db/sysdb.c b/src/db/sysdb.c index d3b479aa24a73c1e3e8ac0d34713e7045b307361..7b3757e748ca20accf95289a97a7ee66b373d749 100644 --- a/src/db/sysdb.c +++ b/src/db/sysdb.c @@ -300,8 +300,8 @@ struct sysdb_attrs *sysdb_new_attrs(TALLOC_CTX *mem_ctx) return talloc_zero(mem_ctx, struct sysdb_attrs); } -static int sysdb_attrs_get_el_int(struct sysdb_attrs *attrs, const char *name, - bool alloc, struct ldb_message_element **el) +int sysdb_attrs_get_el_ext(struct sysdb_attrs *attrs, const char *name, + bool alloc, struct ldb_message_element **el) { struct ldb_message_element *e = NULL; int i; @@ -340,7 +340,7 @@ static int sysdb_attrs_get_el_int(struct sysdb_attrs *attrs, const char *name, int sysdb_attrs_get_el(struct sysdb_attrs *attrs, const char *name, struct ldb_message_element **el) { - return sysdb_attrs_get_el_int(attrs, name, true, el); + return sysdb_attrs_get_el_ext(attrs, name, true, el); } int sysdb_attrs_get_string(struct sysdb_attrs *attrs, const char *name, @@ -349,7 +349,7 @@ int sysdb_attrs_get_string(struct sysdb_attrs *attrs, const char *name, struct ldb_message_element *el; int ret; - ret = sysdb_attrs_get_el_int(attrs, name, false, &el); + ret = sysdb_attrs_get_el_ext(attrs, name, false, &el); if (ret) { return ret; } @@ -370,7 +370,7 @@ int sysdb_attrs_get_uint32_t(struct sysdb_attrs *attrs, const char *name, char *endptr; uint32_t val; - ret = sysdb_attrs_get_el_int(attrs, name, false, &el); + ret = sysdb_attrs_get_el_ext(attrs, name, false, &el); if (ret) { return ret; } @@ -396,7 +396,7 @@ int sysdb_attrs_get_uint16_t(struct sysdb_attrs *attrs, const char *name, char *endptr; uint16_t val; - ret = sysdb_attrs_get_el_int(attrs, name, false, &el); + ret = sysdb_attrs_get_el_ext(attrs, name, false, &el); if (ret) { return ret; } @@ -420,7 +420,7 @@ errno_t sysdb_attrs_get_bool(struct sysdb_attrs *attrs, const char *name, struct ldb_message_element *el; int ret; - ret = sysdb_attrs_get_el_int(attrs, name, false, &el); + ret = sysdb_attrs_get_el_ext(attrs, name, false, &el); if (ret) { return ret; } @@ -444,7 +444,7 @@ int sysdb_attrs_get_string_array(struct sysdb_attrs *attrs, const char *name, unsigned int u; const char **a; - ret = sysdb_attrs_get_el_int(attrs, name, false, &el); + ret = sysdb_attrs_get_el_ext(attrs, name, false, &el); if (ret) { return ret; } diff --git a/src/db/sysdb.h b/src/db/sysdb.h index 7e3d292ff2cf5c15cd5e3278f0d40a74687e7eae..879196a5dd4b32e86a45042d9eecfee7fe0fa52f 100644 --- a/src/db/sysdb.h +++ b/src/db/sysdb.h @@ -218,6 +218,8 @@ int sysdb_attrs_add_time_t(struct sysdb_attrs *attrs, const char *name, time_t value); int sysdb_attrs_get_el(struct sysdb_attrs *attrs, const char *name, struct ldb_message_element **el); +int sysdb_attrs_get_el_ext(struct sysdb_attrs *attrs, const char *name, + bool alloc, struct ldb_message_element **el); int sysdb_attrs_steal_string(struct sysdb_attrs *attrs, const char *name, char *str); int sysdb_attrs_get_string(struct sysdb_attrs *attrs, const char *name, -- 1.7.11.2