Skip to content
  • Evan Hunt's avatar
    add an iterator argument to dns_qp_lookup() · 947bc0a4
    Evan Hunt authored
    the 'predecessor' argument to dns_qp_lookup() turns out not to
    be sufficient for our needs: the predecessor node in a QP database
    could have become "empty" (for the current version) because of an
    update or because cache data expired, and in that case the caller
    would have to iterate more than one step back to find the predecessor
    node that it needs.
    
    it may also be necessary for a caller to iterate forward, in
    order to determine whether a node has any children.
    
    for both of these reasons, we now replace the 'predecessor'
    argument with an 'iter' argument. if set, this points to memory
    with enough space for a dns_qpiter object.
    
    when an exact match is found by the lookup, the iterator will be
    pointing to the matching node. if not, it will be pointing to the
    lexical predecessor of the nae that was searched for.
    
    a dns_qpiter_current() method has been added for examining
    the current value of the iterator without moving it in either
    direction.
    947bc0a4