Logo Search packages:      
Sourcecode: yaz version File versions

YAZ_EXPORT void ccl_rpn_delete ( struct ccl_rpn_node rpn  ) 

Delete RPN tree returned by ccl_find

ccl_rpn_delete: Delete RPN tree. rpn: Pointer to tree.

Definition at line 201 of file cclfind.c.

References ccl_rpn_delete(), ccl_rpn_attr::kind, ccl_rpn_node::kind, ccl_rpn_attr::next, ccl_rpn_node::p, ccl_rpn_attr::set, ccl_rpn_node::setname, ccl_rpn_attr::str, ccl_rpn_node::t, ccl_rpn_node::u, and ccl_rpn_attr::value.

Referenced by ccl_parser_find(), ccl_rpn_delete(), find_spec(), qualifiers1(), search_elements(), search_term_x(), and search_terms().

{
    struct ccl_rpn_attr *attr, *attr1;
    if (!rpn)
        return;
    switch (rpn->kind)
    {
    case CCL_RPN_AND:
    case CCL_RPN_OR:
    case CCL_RPN_NOT:
        ccl_rpn_delete (rpn->u.p[0]);
        ccl_rpn_delete (rpn->u.p[1]);
        break;
    case CCL_RPN_TERM:
        xfree (rpn->u.t.term);
        for (attr = rpn->u.t.attr_list; attr; attr = attr1)
        {
            attr1 = attr->next;
          if (attr->kind == CCL_RPN_ATTR_STRING)
            xfree(attr->value.str);
            if (attr->set)
                xfree (attr->set);
            xfree (attr);
        }
        break;
    case CCL_RPN_SET:
        xfree (rpn->u.setname);
        break;
    case CCL_RPN_PROX:
        ccl_rpn_delete (rpn->u.p[0]);
        ccl_rpn_delete (rpn->u.p[1]);
        ccl_rpn_delete (rpn->u.p[2]);
        break;
    }
    xfree (rpn);
}


Generated by  Doxygen 1.6.0   Back to index