Implements CCL qualifier utilities. More...
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <yaz/snprintf.h>#include <yaz/tokenizer.h>#include "cclp.h"Go to the source code of this file.
Data Structures | |
| struct | ccl_qualifier |
| struct | ccl_qualifiers |
| struct | ccl_qualifier_special |
Functions | |
| static struct ccl_qualifier * | ccl_qual_lookup (CCL_bibset b, const char *n, size_t len) |
| void | ccl_qual_add_special_ar (CCL_bibset bibset, const char *n, const char **values) |
| void | ccl_qual_add_special (CCL_bibset bibset, const char *n, const char *cp) |
| void | ccl_qual_add_combi (CCL_bibset b, const char *n, const char **names) |
| adds specifies qualifier aliases | |
| void | ccl_qual_add_set (CCL_bibset b, const char *name, int no, int *type_ar, int *value_ar, char **svalue_ar, char **attsets) |
| adds specifies attributes for qualifier | |
| CCL_bibset | ccl_qual_mk (void) |
| creates Bibset | |
| void | ccl_qual_rm (CCL_bibset *b) |
| destroys Bibset | |
| ccl_qualifier_t | ccl_qual_search (CCL_parser cclp, const char *name, size_t name_len, int seq) |
| struct ccl_rpn_attr * | ccl_qual_get_attr (ccl_qualifier_t q) |
| const char * | ccl_qual_get_name (ccl_qualifier_t q) |
| const char ** | ccl_qual_search_special (CCL_bibset b, const char *name) |
| int | ccl_search_stop (CCL_bibset bibset, const char *qname, const char *src_str, size_t src_len) |
Implements CCL qualifier utilities.
Definition in file cclqual.c.
| void ccl_qual_add_combi | ( | CCL_bibset | b, | |
| const char * | n, | |||
| const char ** | names | |||
| ) |
adds specifies qualifier aliases
| b | bibset | |
| n | qualifier name | |
| names | list of qualifier aliases |
Definition at line 110 of file cclqual.c.
References ccl_qualifier::attr_list, ccl_qual_lookup(), ccl_qualifiers::list, ccl_qualifier::name, ccl_qualifier::next, ccl_qualifier::no_sub, ccl_qualifier::sub, xmalloc, and xstrdup.
Referenced by ccl_qual_field2().
| void ccl_qual_add_set | ( | CCL_bibset | b, | |
| const char * | name, | |||
| int | no, | |||
| int * | type_ar, | |||
| int * | value_ar, | |||
| char ** | svalue_ar, | |||
| char ** | attsets | |||
| ) |
adds specifies attributes for qualifier
| b | bibset | |
| name | qualifier name | |
| no | number of attribute type+value pairs | |
| type_ar | attributes type of size no | |
| value_ar | attribute value of size no | |
| svalue_ar | attribute string values ([i] only used if != NULL) | |
| attsets | attribute sets of size no |
Definition at line 144 of file cclqual.c.
References ccl_qualifier::attr_list, ccl_assert, CCL_RPN_ATTR_NUMERIC, CCL_RPN_ATTR_STRING, ccl_rpn_attr::kind, ccl_qualifiers::list, ccl_qualifier::name, ccl_rpn_attr::next, ccl_qualifier::next, ccl_qualifier::no_sub, ccl_rpn_attr::numeric, ccl_rpn_attr::set, ccl_rpn_attr::str, ccl_qualifier::sub, ccl_rpn_attr::type, ccl_rpn_attr::value, xmalloc, and xstrdup.
Referenced by ccl_qual_field2().
| void ccl_qual_add_special | ( | CCL_bibset | bibset, | |
| const char * | n, | |||
| const char * | cp | |||
| ) |
Add special qualifier
Definition at line 77 of file cclqual.c.
References ccl_qual_add_special_ar(), xmalloc, xrealloc, xstrdup, yaz_tok_cfg_create(), yaz_tok_cfg_destroy(), yaz_tok_move(), yaz_tok_parse_buf(), yaz_tok_parse_destroy(), yaz_tok_parse_string(), and YAZ_TOK_STRING.
Referenced by ccl_qual_fitem(), and ccl_xml_config_directive().
| void ccl_qual_add_special_ar | ( | CCL_bibset | bibset, | |
| const char * | n, | |||
| const char ** | values | |||
| ) |
Definition at line 51 of file cclqual.c.
References ccl_qualifier_special::name, ccl_qualifier_special::next, ccl_qualifiers::special, ccl_qualifier_special::values, xfree, xmalloc, and xstrdup.
Referenced by ccl_qual_add_special().
| struct ccl_rpn_attr* ccl_qual_get_attr | ( | ccl_qualifier_t | q | ) | [read] |
Definition at line 302 of file cclqual.c.
References ccl_qualifier::attr_list.
Referenced by qual_val_type(), and search_term_x().
| const char* ccl_qual_get_name | ( | ccl_qualifier_t | q | ) |
Definition at line 307 of file cclqual.c.
References ccl_qualifier::name.
Referenced by search_term_x().
| static struct ccl_qualifier* ccl_qual_lookup | ( | CCL_bibset | b, | |
| const char * | n, | |||
| size_t | len | |||
| ) | [static, read] |
Definition at line 41 of file cclqual.c.
References ccl_qualifiers::list, ccl_qualifier::name, and ccl_qualifier::next.
Referenced by ccl_qual_add_combi().
| CCL_bibset ccl_qual_mk | ( | void | ) |
creates Bibset
Definition at line 201 of file cclqual.c.
References ccl_assert, ccl_qualifiers::list, ccl_qualifiers::special, and xmalloc.
Referenced by xml_config_read(), and ZOOM_query_ccl2rpn().
| void ccl_qual_rm | ( | CCL_bibset * | b | ) |
destroys Bibset
| b | pointer to Bibset |
b will be set to NULL.
Definition at line 215 of file cclqual.c.
References ccl_qualifier::attr_list, CCL_RPN_ATTR_STRING, ccl_rpn_attr::kind, ccl_qualifier_special::name, ccl_qualifier::name, ccl_qualifier_special::next, ccl_qualifier::next, ccl_rpn_attr::next, ccl_rpn_attr::set, ccl_rpn_attr::str, ccl_qualifier::sub, ccl_rpn_attr::value, ccl_qualifier_special::values, and xfree.
Referenced by ZOOM_query_ccl2rpn().
| ccl_qualifier_t ccl_qual_search | ( | CCL_parser | cclp, | |
| const char * | name, | |||
| size_t | name_len, | |||
| int | seq | |||
| ) |
Definition at line 258 of file cclqual.c.
References ccl_parser::bibset, ccl_assert, ccl_parser::ccl_case_sensitive, ccl_memicmp(), ccl_qual_search_special(), ccl_qualifiers::list, ccl_qualifier::name, ccl_qualifier::next, ccl_qualifier::no_sub, and ccl_qualifier::sub.
Referenced by qualifier_list(), and search_elements().
| const char** ccl_qual_search_special | ( | CCL_bibset | b, | |
| const char * | name | |||
| ) |
Search for special qualifier
Definition at line 312 of file cclqual.c.
References ccl_qualifier_special::name, ccl_qualifier_special::next, ccl_qualifiers::special, and ccl_qualifier_special::values.
Referenced by ccl_parser_tokenize(), ccl_qual_search(), ccl_search_stop(), qualifier_list(), search_term_x(), and token_cmp().
| int ccl_search_stop | ( | CCL_bibset | bibset, | |
| const char * | qname, | |||
| const char * | src_str, | |||
| size_t | src_len | |||
| ) |
Definition at line 324 of file cclqual.c.
References ccl_memicmp(), ccl_qual_search_special(), and yaz_snprintf().
Referenced by ccl_remove_stop_r().
1.6.3