Logo Search packages:      
Sourcecode: yaz version File versions

YAZ_EXPORT struct ccl_rpn_attr* ccl_qual_search ( CCL_parser  cclp,
const char *  name,
size_t  len,
int  seq 
) [read]

Search for qualifier 'name' in set 'b'.

ccl_qual_search: Search for qualifier in bibset. b: Bibset name: Name of qualifier to search for (need no null-termination) len: Length of name. return: Attribute info. NULL if not found.

Definition at line 322 of file cclqual.c.

References ccl_qualifier::attr_list, ccl_parser::bibset, ccl_parser::ccl_case_sensitive, ccl_memicmp(), ccl_qual_search_special(), ccl_qualifiers::list, ccl_qualifier::name, ccl_qualifier::next, and ccl_qualifier::sub.

Referenced by qualifiers1(), and search_elements().

{
    struct ccl_qualifier *q;
    const char *aliases;
    int case_sensitive = cclp->ccl_case_sensitive;

    ccl_assert (cclp);
    if (!cclp->bibset)
      return NULL;

    aliases = ccl_qual_search_special(cclp->bibset, "case");
    if (aliases)
      case_sensitive = atoi(aliases);

    for (q = cclp->bibset->list; q; q = q->next)
        if (strlen(q->name) == len)
        {
            if (case_sensitive)
            {
                if (!memcmp (name, q->name, len))
                    break;
            }
            else
            {
                if (!ccl_memicmp (name, q->name, len))
                    break;
            }
        }
    if (q)
    {
        if (q->attr_list && seq == 0)
            return q->attr_list;
        if (seq < q->no_sub && q->sub[seq])
        {
            return q->sub[seq]->attr_list;
        }
    }
    return 0;
}


Generated by  Doxygen 1.6.0   Back to index