]> git.sur5r.net Git - openldap/commitdiff
use BVC() macro (changed in BER_BVC) to initialize constant bervals
authorPierangelo Masarati <ando@openldap.org>
Mon, 8 Apr 2002 18:37:37 +0000 (18:37 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 8 Apr 2002 18:37:37 +0000 (18:37 +0000)
include/lber_pvt.h
servers/slapd/acl.c
servers/slapd/root_dse.c

index 9fdd67f2c4bac9e1fa5215a1146790a7e40fffe7..6fd8eb2c6bc88542a7c0348670ec2bd69e536364 100644 (file)
@@ -86,6 +86,8 @@ ber_pvt_socket_set_nonblock LDAP_P(( ber_socket_t sd, int nb ));
 #define ber_bvchr(bv,c) \
        memchr( (bv)->bv_val, (c), (bv)->bv_len )
 
+#define BER_BVC(x) { sizeof( (x) ) - 1, (x) }
+
 LDAP_END_DECL
 
 #endif
index fb6701f773e45dc14c661e3b038fa625d3bfc923..f3433e90082af5bbc941ffc9daa91fb1caa1bef7 100644 (file)
  * speed up compares
  */
 static struct berval 
-       aci_bv_entry            = { sizeof("entry") - 1,        "entry" },
-       aci_bv_br_entry         = { sizeof("[entry]") - 1,      "[entry]" },
-       aci_bv_br_all           = { sizeof("[all]") - 1,        "[all]" },
-       aci_bv_access_id        = { sizeof("access-id") - 1,    "access-id" },
-       aci_bv_anonymous        = { sizeof("anonymous") - 1,    "anonymous" },
-       aci_bv_users            = { sizeof("users") - 1,        "users" },
-       aci_bv_self             = { sizeof("self") - 1,         "self" },
-       aci_bv_dnattr           = { sizeof("dnattr") - 1,       "dnattr" },
-       aci_bv_group            = { sizeof("group") - 1,        "group" },
-       aci_bv_role             = { sizeof("role") - 1,         "role" },
-       aci_bv_set              = { sizeof("set") - 1,          "set" },
-       aci_bv_set_ref          = { sizeof("set-ref") - 1,      "set-ref"},
-       aci_bv_grant            = { sizeof("grant") - 1,        "grant" },
-       aci_bv_deny             = { sizeof("deny") - 1,         "deny" };
+       aci_bv_entry            = BER_BVC("entry"),
+       aci_bv_br_entry         = BER_BVC("[entry]"),
+       aci_bv_br_all           = BER_BVC("[all]"),
+       aci_bv_access_id        = BER_BVC("access-id"),
+       aci_bv_anonymous        = BER_BVC("anonymous"),
+       aci_bv_users            = BER_BVC("users"),
+       aci_bv_self             = BER_BVC("self"),
+       aci_bv_dnattr           = BER_BVC("dnattr"),
+       aci_bv_group            = BER_BVC("group"),
+       aci_bv_role             = BER_BVC("role"),
+       aci_bv_set              = BER_BVC("set"),
+       aci_bv_set_ref          = BER_BVC("set-ref"),
+       aci_bv_grant            = BER_BVC("grant"),
+       aci_bv_deny             = BER_BVC("deny");
 
 static AccessControl * acl_get(
        AccessControl *ac, int *count,
index 939761e1415dff336a0328a667fcdeaf34be5e86..b52e3558b499e1dcf6904203d5aeaec1bcfaabce 100644 (file)
 
 #include "slap.h"
 #include <ldif.h>
-
-#define BVC(x) {sizeof(x)-1, x}
+#include "lber_pvt.h"
 
 static struct berval supportedFeatures[] = {
-       BVC("1.3.6.1.4.1.4203.1.5.1"), /* all Operational Attributes ("+") */
-       BVC("1.3.6.1.4.1.4203.1.5.2"), /* OCs in Attributes List */
-       BVC("1.3.6.1.4.1.4203.1.5.3"), /* (&) and (|) search filters */
-       BVC("1.3.6.1.4.1.4203.1.5.4"), /* Language Tag Options */
-       BVC("1.3.6.1.4.1.4203.1.5.5"), /* Language Range Options */
+       BER_BVC("1.3.6.1.4.1.4203.1.5.1"), /* all Operational Attributes ("+") */
+       BER_BVC("1.3.6.1.4.1.4203.1.5.2"), /* OCs in Attributes List */
+       BER_BVC("1.3.6.1.4.1.4203.1.5.3"), /* (&) and (|) search filters */
+       BER_BVC("1.3.6.1.4.1.4203.1.5.4"), /* Language Tag Options */
+       BER_BVC("1.3.6.1.4.1.4203.1.5.5"), /* Language Range Options */
        {0,NULL}
 };