YAZ  5.23.1
Data Structures | Functions
cclqual.c File Reference

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_qualifierccl_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)
 
static struct ccl_qualifierccl_qual_new (CCL_bibset b, const char *name)
 
void ccl_qual_add_combi (CCL_bibset b, const char *n, const char **names)
 adds specifies qualifier aliases More...
 
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 More...
 
CCL_bibset ccl_qual_mk (void)
 creates Bibset More...
 
void ccl_qual_rm (CCL_bibset *b)
 destroys Bibset More...
 
CCL_bibset ccl_qual_dup (CCL_bibset b)
 
ccl_qualifier_t ccl_qual_search (CCL_parser cclp, const char *name, size_t name_len, int seq)
 
struct ccl_rpn_attrccl_qual_get_attr (ccl_qualifier_t q)
 
struct ccl_rpn_attrccl_parser_qual_search (CCL_parser cclp, const char *name, size_t name_len)
 
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)
 

Detailed Description

Implements CCL qualifier utilities.

Definition in file cclqual.c.

Function Documentation

struct ccl_rpn_attr* ccl_parser_qual_search ( CCL_parser  cclp,
const char *  name,
size_t  name_len 
)

Definition at line 387 of file cclqual.c.

References ccl_qualifier::attr_list, and ccl_qual_search().

void ccl_qual_add_combi ( CCL_bibset  b,
const char *  n,
const char **  names 
)

adds specifies qualifier aliases

Parameters
bbibset
nqualifier name
nameslist of qualifier aliases

Definition at line 127 of file cclqual.c.

References ccl_qualifier::attr_list, ccl_qual_lookup(), ccl_qual_new(), 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

Parameters
bbibset
namequalifier name
nonumber of attribute type+value pairs
type_arattributes type of size no
value_arattribute value of size no
svalue_arattribute string values ([i] only used if != NULL)
attsetsattribute sets of size no

Definition at line 165 of file cclqual.c.

References ccl_qualifier::attr_list, ccl_assert, ccl_qual_new(), CCL_RPN_ATTR_NUMERIC, CCL_RPN_ATTR_STRING, ccl_rpn_attr::kind, ccl_qualifiers::list, ccl_qualifier::name, ccl_qualifier::next, ccl_rpn_attr::next, ccl_rpn_attr::numeric, ccl_rpn_attr::set, ccl_rpn_attr::str, ccl_rpn_attr::type, ccl_rpn_attr::value, and xmalloc.

Referenced by ccl_qual_field2().

void ccl_qual_add_special ( CCL_bibset  bibset,
const char *  n,
const char *  cp 
)
void ccl_qual_add_special_ar ( CCL_bibset  bibset,
const char *  n,
const char **  values 
)
CCL_bibset ccl_qual_dup ( CCL_bibset  b)
struct ccl_rpn_attr* ccl_qual_get_attr ( ccl_qualifier_t  q)

Definition at line 382 of file cclqual.c.

References ccl_qualifier::attr_list.

Referenced by ccl_term_multi_use(), ccl_term_one_use(), and qual_val_type().

const char* ccl_qual_get_name ( ccl_qualifier_t  q)

Definition at line 396 of file cclqual.c.

References ccl_qualifier::name.

Referenced by ccl_term_one_use().

static struct ccl_qualifier* ccl_qual_lookup ( CCL_bibset  b,
const char *  n,
size_t  len 
)
static

Definition at line 45 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

Returns
bibset

Definition at line 210 of file cclqual.c.

References ccl_assert, ccl_qualifiers::list, ccl_qualifiers::special, and xmalloc.

Referenced by ccl_qual_dup(), xml_config_read(), and ZOOM_query_ccl2rpn().

static struct ccl_qualifier* ccl_qual_new ( CCL_bibset  b,
const char *  name 
)
static
void ccl_qual_rm ( CCL_bibset b)
ccl_qualifier_t ccl_qual_search ( CCL_parser  cclp,
const char *  name,
size_t  name_len,
int  seq 
)
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 
)

Definition at line 413 of file cclqual.c.

References ccl_memicmp(), ccl_qual_search_special(), and yaz_snprintf().

Referenced by ccl_remove_stop_r().