]> git.sur5r.net Git - openldap/blobdiff - include/lber_pvt.h
add feature macros
[openldap] / include / lber_pvt.h
index b2f808d4a0ab91c33ade448d2f0952c949ab99fc..6fd8eb2c6bc88542a7c0348670ec2bd69e536364 100644 (file)
@@ -1,6 +1,6 @@
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2001 The OpenLDAP Foundation, Redwood City, California, USA
+ * Copyright 1998-2002 The OpenLDAP Foundation, Redwood City, California, USA
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -61,6 +61,33 @@ ber_pvt_sb_copy_out LDAP_P(( Sockbuf_Buf *sbb, char *buf, ber_len_t len ));
 LBER_F( int )
 ber_pvt_socket_set_nonblock LDAP_P(( ber_socket_t sd, int nb ));
 
+
+#if 0
+#define ber_bvstrcmp(v1,v2) \
+       ((v1)->bv_len < (v2)->bv_len \
+               ? -1 : ((v1)->bv_len > (v2)->bv_len \
+                       ? 1 : strncmp((v1)->bv_val, (v2)->bv_val, (v1)->bv_len) ))
+#else
+       /* avoid strncmp() */
+#define ber_bvstrcmp(v1,v2)    ber_bvcmp((v1),(v2))
+#endif
+
+#define ber_bvstrcasecmp(v1,v2) \
+       ((v1)->bv_len < (v2)->bv_len \
+               ? -1 : ((v1)->bv_len > (v2)->bv_len \
+                       ? 1 : strncasecmp((v1)->bv_val, (v2)->bv_val, (v1)->bv_len) ))
+
+#define ber_bvccmp(v1,c) \
+       ( (v1)->bv_len == 1 && (v1)->bv_val[0] == (c) )
+
+#define ber_strccmp(s,c) \
+       ( (s)[0] == (c) && (s)[1] == '\0' )
+
+#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