add bverb_to_mask() API

This commit is contained in:
Pierangelo Masarati 2006-08-17 16:10:17 +00:00
parent 8ac5a02eb2
commit c458df6441
2 changed files with 11 additions and 2 deletions

View File

@ -880,14 +880,21 @@ done:
/* restrictops, allows, disallows, requires, loglevel */
int
verb_to_mask(const char *word, slap_verbmasks *v) {
bverb_to_mask(struct berval *bword, slap_verbmasks *v) {
int i;
for(i = 0; !BER_BVISNULL(&v[i].word); i++) {
if(!strcasecmp(word, v[i].word.bv_val)) break;
if(!ber_bvstrcasecmp(bword, &v[i].word)) break;
}
return(i);
}
int
verb_to_mask(const char *word, slap_verbmasks *v) {
struct berval bword;
ber_str2bv( word, 0, 0, &bword );
return bverb_to_mask( &bword, v );
}
int
verbs_to_mask(int argc, char *argv[], slap_verbmasks *v, slap_mask_t *m) {
int i, j;

View File

@ -589,6 +589,8 @@ LDAP_SLAPD_F (int) read_config LDAP_P(( const char *fname, const char *dir ));
LDAP_SLAPD_F (void) config_destroy LDAP_P ((void));
LDAP_SLAPD_F (char **) slap_str2clist LDAP_P((
char ***, char *, const char * ));
LDAP_SLAPD_F (int) bverb_to_mask LDAP_P((
struct berval *bword, slap_verbmasks *v ));
LDAP_SLAPD_F (int) verb_to_mask LDAP_P((
const char *word, slap_verbmasks *v ));
LDAP_SLAPD_F (int) verbs_to_mask LDAP_P((