Add tldap_pull_uint32
authorVolker Lendecke <vl@samba.org>
Sun, 7 Jun 2009 17:08:52 +0000 (19:08 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 7 Jun 2009 21:14:40 +0000 (23:14 +0200)
source3/include/tldap_util.h
source3/lib/tldap_util.c

index 2d5cf57a9c70ffdb085771395a2609e8b72c7e71..1c993769d76ddb9463386129f0b253b93760fbe7 100644 (file)
@@ -49,5 +49,7 @@ int tldap_search_fmt(struct tldap_context *ld, const char *base, int scope,
                     const char *fmt, ...);
 bool tldap_pull_uint64(struct tldap_message *msg, const char *attr,
                       uint64_t *presult);
+bool tldap_pull_uint32(struct tldap_message *msg, const char *attr,
+                      uint32_t *presult);
 
 #endif
index 1f2cc1d8de88523479506ae6dfdb889e43b93af2..1b0c3446ee633e78d5655d1ba86d44b535a37b64 100644 (file)
@@ -349,3 +349,15 @@ bool tldap_pull_uint64(struct tldap_message *msg, const char *attr,
        *presult = result;
        return true;
 }
+
+bool tldap_pull_uint32(struct tldap_message *msg, const char *attr,
+                      uint32_t *presult)
+{
+       uint64_t result;
+
+       if (!tldap_pull_uint64(msg, attr, &result)) {
+               return false;
+       }
+       *presult = (uint32_t)result;
+       return true;
+}