X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fsets.h;h=af5d809dc7e7e925e775a32f51879b42fb6ec75e;hb=173330187ef1a4139e2e4c4fb30ad23832e40f77;hp=c02fd76c9249b2beb64726ee5a8573f064b3b88b;hpb=4e15a84452f0493b1b5bc7b779c7bd1cd4fa4b73;p=openldap diff --git a/servers/slapd/sets.h b/servers/slapd/sets.h index c02fd76c92..af5d809dc7 100644 --- a/servers/slapd/sets.h +++ b/servers/slapd/sets.h @@ -1,7 +1,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2003 The OpenLDAP Foundation. + * Copyright 1998-2005 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,17 +29,47 @@ typedef struct slap_set_cookie { * also return the syntax or some "comparison cookie" * that is used by set_filter. */ -typedef BerVarray (SLAP_SET_GATHER)( - SetCookie *cookie, struct berval *name, struct berval *attr); - -LDAP_SLAPD_F (long) slap_set_size(BerVarray set); -LDAP_SLAPD_F (void) slap_set_dispose(SetCookie *cookie, BerVarray set); +typedef BerVarray (SLAP_SET_GATHER)( SetCookie *cookie, + struct berval *name, AttributeDescription *ad); LDAP_SLAPD_F (int) slap_set_filter( SLAP_SET_GATHER gatherer, SetCookie *cookie, struct berval *filter, - struct berval *user, struct berval *this, BerVarray *results); + struct berval *user, struct berval *target, BerVarray *results); + +LDAP_SLAPD_F (BerVarray) slap_set_join(SetCookie *cp, + BerVarray lset, unsigned op, BerVarray rset); + +#define SLAP_SET_OPMASK 0x00FF + +#define SLAP_SET_REFARR 0x0100 +#define SLAP_SET_REFVAL 0x0200 +#define SLAP_SET_REF (SLAP_SET_REFARR|SLAP_SET_REFVAL) + +/* The unsigned "op" can be ORed with the flags below; + * - if the rset's values must not be freed, or must be copied if kept, + * it is ORed with SLAP_SET_RREFVAL + * - if the rset array must not be freed, or must be copied if kept, + * it is ORed with SLAP_SET_RREFARR + * - the same applies to the lset with SLAP_SET_LREFVAL and SLAP_SET_LREFARR + * - it is assumed that SLAP_SET_REFVAL implies SLAP_SET_REFARR, + * i.e. the former is checked only if the latter is defined. + */ + +#define SLAP_SET_RREFARR SLAP_SET_REFARR +#define SLAP_SET_RREFVAL SLAP_SET_REFVAL +#define SLAP_SET_RREF SLAP_SET_REF +#define SLAP_SET_RREFMASK 0x0F00 +#define SLAP_SET_RREF2REF(r) ((r) & SLAP_SET_RREFMASK) + +#define SLAP_SET_LREFARR 0x1000 +#define SLAP_SET_LREFVAL 0x2000 +#define SLAP_SET_LREF (SLAP_SET_LREFARR|SLAP_SET_LREFVAL) +#define SLAP_SET_LREFMASK 0xF000 + +#define SLAP_SET_LREF2REF(r) (((r) & SLAP_SET_LREFMASK) >> 4) + LDAP_END_DECL #endif