49 const char *value_str = 0;
50 int type = 0, value = 0;
57 attsets[pair_no] = lead_str;
61 *addinfo =
"token expected";
68 *addinfo =
"= expected";
87 qlist[i++] = lead_str;
91 if (i <
sizeof(qlist)/
sizeof(*qlist)-1)
98 for (i = 0; qlist[i]; i++)
108 *addinfo =
"value token expected";
113 if (sscanf(type_str,
"%d", &
type) == 1)
115 else if (strlen(type_str) != 1)
117 *addinfo =
"bad attribute type";
181 *addinfo =
"bad attribute type";
184 type_ar[pair_no] =
type;
187 value_ar[pair_no] = value;
188 svalue_ar[pair_no] = 0;
190 else if (*value_str >=
'0' && *value_str <=
'9')
192 value_ar[pair_no] = atoi (value_str);
193 svalue_ar[pair_no] = 0;
197 value_ar[pair_no] = 0;
198 svalue_ar[pair_no] =
xstrdup(value_str);
203 *addinfo =
"too many attribute values";
209 attsets[pair_no] = attsets[pair_no-1];
221 for (i = 0; i<pair_no; i++)
242 const char **addinfo)
244 if (*qual_name ==
'@')
257 const char *addinfo = 0;
263 const char *cp1 = buf;
267 const char *cp2 = cp1;
269 while (*cp2 && !strchr(
"\r\n", *cp2))
274 if (len >= (
sizeof(line)-1))
275 len =
sizeof(line)-1;
276 memcpy(line, cp1, len);
290 char *cp1, *cp = line;
294 if (sscanf (cp,
"%100s%n", qual_name, &no_scan) < 1)
297 cp1 = strchr(cp,
'#');
320 while (fgets (line, 255, inf))
327 inf = fopen (fname,
"r");
Header with public definitions for CCL.
#define CCL_BIB1_TRU_CAN_NONE
#define CCL_BIB1_REL_ORDER
#define CCL_BIB1_TRU_CAN_LEFT
#define CCL_BIB1_TRU_CAN_Z3958
#define CCL_BIB1_REL_PORDER
#define CCL_BIB1_REL_OMIT_EQUALS
#define CCL_BIB1_USE
common attributes
#define CCL_BIB1_STR_AUTO_GROUP
#define CCL_BIB1_TRU_CAN_REGEX
#define CCL_BIB1_TRU_CAN_BOTH
#define CCL_BIB1_TRU_CAN_RIGHT
#define CCL_BIB1_STR_OR_LIST
#define CCL_BIB1_STR_AND_LIST
#define CCL_BIB1_STR_SPLIT_LIST
int ccl_qual_fname(CCL_bibset bibset, const char *fname)
int ccl_qual_fitem2(CCL_bibset bibset, const char *cp, const char *qual_name, const char **addinfo)
void ccl_qual_file(CCL_bibset bibset, FILE *inf)
int ccl_qual_field2(CCL_bibset bibset, const char *cp, const char *qual_name, const char **addinfo)
void ccl_qual_fitem(CCL_bibset bibset, const char *cp, const char *qual_name)
void ccl_qual_field(CCL_bibset bibset, const char *cp, const char *qual_name)
void ccl_qual_line(CCL_bibset bibset, char *line)
void ccl_qual_buf(CCL_bibset bibset, const char *buf)
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
void ccl_qual_add_combi(CCL_bibset b, const char *n, const char **names)
adds specifies qualifier aliases
void ccl_qual_add_special(CCL_bibset bibset, const char *n, const char *cp)
int ccl_stricmp(const char *s1, const char *s2)
void yaz_log(int level, const char *fmt,...)
Writes log message.
#define YLOG_WARN
log level: warning
yaz_tok_parse_t yaz_tok_parse_buf(yaz_tok_cfg_t t, const char *buf)
yaz_tok_cfg_t yaz_tok_cfg_create(void)
const char * yaz_tok_parse_string(yaz_tok_parse_t tp)
void yaz_tok_parse_destroy(yaz_tok_parse_t tp)
void yaz_tok_cfg_single_tokens(yaz_tok_cfg_t t, const char *simple)
void yaz_tok_cfg_destroy(yaz_tok_cfg_t t)
int yaz_tok_move(yaz_tok_parse_t tp)
Header with public definitions about YAZ' tokenizer.
#define xstrdup(s)
utility macro which calls xstrdup_f
#define xfree(x)
utility macro which calls xfree_f