#define HASH_Update(c,buf,len) lutil_HASHUpdate(c,buf,len)
#define HASH_Final(d,c) lutil_HASHFinal(d,c)
+#define SLAP_NVALUES 1
+
#ifdef SLAP_NVALUES
/* TO BE DELETED */
#define SLAP_MR_DN_FOLD (0)
#define caseExactNormalize UTF8StringNormalize
#define caseIgnoreNormalize UTF8StringNormalize
-#define integerNormalize NULL
#define integerFirstComponentNormalize NULL
#define objectIdentifierNormalize NULL
#define objectIdentifierFirstComponentNormalize NULL
-#define generalizedTimeNormalize NULL
-#define bitStringNormalize NULL
#define distinguishedNameNormalize dnNormalize
#define distinguishedNameMatch dnMatch
#define distinguishedNameIndexer octetStringIndexer
#define distinguishedNameFilter octetStringFilter
+#define integerOrderingMatch integerMatch
+#define integerFirstComponentMatch NULL
+#define integerIndexer octetStringIndexer
+#define integerFilter octetStringFilter
+
+#define generalizedTimeMatch caseIgnoreIA5Match
+#define generalizedTimeOrderingMatch caseIgnoreIA5Match
+
#define uniqueMemberMatch dnMatch /* FIXME! */
#define objectIdentifierMatch octetStringMatch
#define bitStringIndexer octetStringIndexer
#define bitStringFilter octetStringFilter
-#define integerMatch NULL
-#define integerOrderingMatch NULL
-#define integerIndexer NULL
-#define integerFilter NULL
-
-#define generalizedTimeMatch NULL
-#define generalizedTimeOrderingMatch NULL
-
#define caseIgnoreMatch octetStringMatch
#define caseIgnoreOrderingMatch octetStringOrderingMatch
#define caseIgnoreIndexer octetStringIndexer
#define objectIdentifierFirstComponentNormalize NULL
#define generalizedTimeNormalize NULL
#define uniqueMemberNormalize NULL
-#define bitStringNormalize NULL
#define telephoneNumberNormalize NULL
flags = SLAP_MR_ASSOCIATED(mr, slap_schema.si_mr_caseExactMatch )
? LDAP_UTF8_NOCASEFOLD : LDAP_UTF8_CASEFOLD;
- flags |= ( use & SLAP_MR_EQUALITY_APPROX == SLAP_MR_EQUALITY_APPROX )
+ flags |= ( ( use & SLAP_MR_EQUALITY_APPROX ) == SLAP_MR_EQUALITY_APPROX )
? LDAP_UTF8_APPROX : 0;
val = UTF8bvnormalize( val, &tmp, flags );
return LDAP_INVALID_SYNTAX;
}
-#ifndef SLAP_NVALUES
-
static int
integerMatch(
int *matchp,
/* Skip leading space/sign/zeroes, and get the sign of the *value number */
v = value->bv_val;
vlen = value->bv_len;
+
+#ifndef SLAP_NVALUES
if( mr == slap_schema.si_mr_integerFirstComponentMatch ) {
char *tmp = memchr( v, '$', vlen );
- if( tmp )
- vlen = tmp - v;
- while( vlen && ASCII_SPACE( v[vlen-1] ))
- vlen--;
+ if( tmp ) vlen = tmp - v;
+ while( vlen && ASCII_SPACE( v[vlen-1] )) vlen--;
+ }
+#endif
+
+ for( ; vlen && ( *v < '1' || '9' < *v ); v++, vlen-- ) { /* ANSI 2.2.1 */
+ if( *v == '-' ) vsign = -1;
}
- for( ; vlen && ( *v < '1' || '9' < *v ); v++, vlen-- ) /* ANSI 2.2.1 */
- if( *v == '-' )
- vsign = -1;
- if( vlen == 0 )
- vsign = 0;
+
+ if( vlen == 0 ) vsign = 0;
/* Do the same with the *assertedValue number */
asserted = (struct berval *) assertedValue;
return LDAP_SUCCESS;
}
-#endif
static int
integerValidate(
Syntax *syntax,
if(( val->bv_val[0] == '+' ) || ( val->bv_val[0] == '-' )) {
if( val->bv_len < 2 ) return LDAP_INVALID_SYNTAX;
+
} else if( !ASCII_DIGIT(val->bv_val[0]) ) {
return LDAP_INVALID_SYNTAX;
}
return LDAP_SUCCESS;
}
-#ifndef SLAP_NVALUES
static int
+#ifdef SLAP_NVALUES
+integerNormalize(
+ slap_mask_t use,
+ Syntax *syntax,
+ MatchingRule *mr,
+ struct berval *val,
+ struct berval *normalized )
+#else
xintegerNormalize(
Syntax *syntax,
struct berval *val,
struct berval *normalized )
+#endif
{
char *p;
int negative=0;
if( len == 0 ) {
normalized->bv_val = ch_strdup("0");
normalized->bv_len = 1;
- }
- else {
+
+ } else {
normalized->bv_len = len+negative;
normalized->bv_val = ch_malloc( normalized->bv_len + 1 );
- if( negative ) {
- normalized->bv_val[0] = '-';
- }
+ if( negative ) normalized->bv_val[0] = '-';
AC_MEMCPY( normalized->bv_val + negative, p, len );
normalized->bv_val[len+negative] = '\0';
}
return LDAP_SUCCESS;
}
+#ifndef SLAP_NVALUES
+
/* Index generation function */
static int integerIndexer(
slap_mask_t use,
return LDAP_SUCCESS;
}
-#ifdef SLAP_NVALUES
static int
+#ifdef SLAP_NVALUES
IA5StringNormalize(
slap_mask_t use,
Syntax *syntax,
struct berval *val,
struct berval *normalized )
#else
-static int
xIA5StringNormalize(
Syntax *syntax,
struct berval *val,
return check_time_syntax(in, 0, parts);
}
-#ifndef SLAP_NVALUES
-
static int
+#ifdef SLAP_NVALUES
+generalizedTimeNormalize(
+ slap_mask_t usage,
+ Syntax *syntax,
+ MatchingRule *mr,
+ struct berval *val,
+ struct berval *normalized )
+#else
xgeneralizedTimeNormalize(
Syntax *syntax,
struct berval *val,
struct berval *normalized )
+#endif
{
int parts[9], rc;
return LDAP_SUCCESS;
}
-#endif
static int
nisNetgroupTripleValidate(
Syntax *syntax,
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.6 )",
SLAP_MR_EQUALITY | SLAP_MR_EXT, NULL,
NULL,
- bitStringNormalize, bitStringMatch,
+ NULL, bitStringMatch,
bitStringIndexer, bitStringFilter,
NULL},