[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: dnParent()



"Kurt D. Zeilenga" wrote:
> 
> At 09:07 AM 2002-01-17, Pierangelo Masarati wrote:
> >Pierangelo Masarati wrote:
> >>
> >> Luke Howard wrote:
> >> >
> >> > Is there any reason why dnParent() is declared non-static but has
> >> > no prototype in proto-slap.h? This function would be useful for
> >> > our NetInfo backend.
> >>
> >> I think the only possible reason is some recent hurry
> >> in working with dn stuff :) I'll fix it in a moment.
> >
> >Howard, I'd like to replace all the occurrences of dn_parent,
> >a lot of which are in back-bdb, with a more efficient function
> >(which is dnParent in an enhanced form). Can I safely assume
> >that bdb_dn2id*() is always invoked with a NORMALIZED dn
> >(e.g. coming out of dnNormalize or related function)?
> 
> I think it is okay for dnParent (and dn_parent) to assume that the
> DN is pretty (dnPretty) or is normalized (dnNormalize), which
> should allow for a very efficient implementation, e.g.:
>         parent = strchr(in,','));
> 
> I note that as soon as dn_parent() is not used in any of the
> primary backends, it should be removed from the frontend.
> Likewise for dn_normalize().  dn_validate() is already history.

That's what I intend to do :)

dn_parent() has a side effect: it fails if the input dn 
is a suffix of the supplied backend, if any; I'd like to 
separate this behavior by defining two functions, one that
tests the dn against the backend suffixes and one that 
climbs the subtree.  I'm still trying to figure out if
in the first case it's better to do both operations in one 
function or keep the two issues separated.

Ando.
-- 
Dr. Pierangelo Masarati               | voice: +39 02 2399 8309
Dip. Ing. Aerospaziale                | fax:   +39 02 2399 8334
Politecnico di Milano                 |
mailto:pierangelo.masarati@polimi.it
via La Masa 34, 20156 Milano, Italy   |
http://www.aero.polimi.it/~masarati