- char *val, *p, *code, *w;
- unsigned i, j, len;
- int indexmask, syntax;
- char buf[SUBLEN + 1];
- char vbuf[BUFSIZ];
- char *bigbuf;
- struct dbcache *db;
-
- char *at_cn; /* Attribute canonical name */
-
- Debug( LDAP_DEBUG_TRACE, "=> index_add_values( \"%s\", %ld )\n", type,
- id, 0 );
- attr_normalize(type);
- attr_masks( be->be_private, type, &indexmask, &syntax );
- if ( indexmask == 0 ) {
- return( 0 );
- }
- at_cn = at_canonical_name( type );
- if ( (db = ldbm_cache_open( be, at_cn, LDBM_SUFFIX, LDBM_WRCREAT ))
- == NULL ) {
- Debug( LDAP_DEBUG_ANY,
- "<= index_add_values -1 (could not open/create %s%s)\n",
- at_cn, LDBM_SUFFIX, 0 );
- return( -1 );
- }
-
-
- for ( i = 0; vals[i] != NULL; i++ ) {
- /*
- * presence index entry
- */
- if ( indexmask & INDEX_PRESENCE ) {
- add_value( be, db, at_cn, INDEX_PRESENCE, "*", id );
- }