]> git.sur5r.net Git - openldap/commitdiff
Explain better what each matching rule function means.
authorJulio Sánchez Fernández <jsanchez@openldap.org>
Fri, 9 Jul 1999 14:29:24 +0000 (14:29 +0000)
committerJulio Sánchez Fernández <jsanchez@openldap.org>
Fri, 9 Jul 1999 14:29:24 +0000 (14:29 +0000)
We need to indexing routines per matching rule.  One (cindex) is used to
create the indexes.  The other (sindex) is used to search.  This is
necessary because the syntax of the value assertion may be different
from the syntax of the attributes the matching rules is used with.
They may be the same function, however, and will be the same in most
cases.

servers/slapd/slap.h

index 23a6aea331252af0bee8945839c108df652bd4f0..7b0f2af49d9ebb5dc097da8bed8d4a6ffddef122 100644 (file)
@@ -240,10 +240,20 @@ typedef struct slap_syntax {
 #define ssyn_oid                       ssyn_syn.syn_oid
 #define ssyn_desc                      ssyn_syn.syn_desc
 
-/* Put a value in some normalized form */
+/*
+ * Put an attribute value (NOT assertion value!) in some normalized
+ * form.  We do not have normalization functions for the assertion
+ * values.
+ */
 typedef int slap_mr_normalize_func LDAP_P((struct berval * val, struct berval **normalized));
 
-/* Check if evals in entry match value in filter */
+/*
+ * Check if evals in entry match value in filter, notice that the
+ * syntax of the fval needs not be the same as the syntax of the
+ * evals.  Returns 1 if true, 0 if false, will someday return -1 if
+ * undefined.
+ */
+
 typedef int slap_mr_check_func LDAP_P((
        struct berval * fval,           /* Value in filter ava */
        struct berval ** evals          /* Values in entry */
@@ -255,7 +265,7 @@ typedef int slap_mr_skeys_func LDAP_P((
        struct berval *** svals         /* Returned search keys */
 ));
 
-/* Find keys to use in searching the indexes */
+/* Find keys to use in searching or creating the indexes */
 typedef int slap_mr_index_func LDAP_P((
        struct berval ** svals,         /* Values for search keys */
        struct berval *** ivals         /* Returned values for indexes */
@@ -267,7 +277,8 @@ typedef struct slap_matching_rule {
        slap_mr_normalize_func          *smr_normalize;
        slap_mr_check_func              *smr_compare;
        slap_mr_skeys_func              *smr_skeys;
-       slap_mr_index_func              *smr_index;
+       slap_mr_index_func              *smr_sindex;
+       slap_mr_index_func              *smr_cindex;
        Syntax                          *smr_syntax;
        struct slap_matching_rule       *smr_next;
 } MatchingRule;