X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fcclqfile.c;h=d2ca1c9d13f5db4a76151b87a32857120b3ad1b6;hp=96c8c75a2b00e3ac42a9191825c8113d4856f1f7;hb=c508282c3e52e145f998d0bb85c0ea6b36fe956c;hpb=ee6ab2ee3a9ee1a8c65d7272ec7fba1d886f5af0 diff --git a/src/cclqfile.c b/src/cclqfile.c index 96c8c75..d2ca1c9 100644 --- a/src/cclqfile.c +++ b/src/cclqfile.c @@ -1,11 +1,14 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2008 Index Data + * Copyright (C) 1995-2011 Index Data * See the file LICENSE for details. */ /** * \file cclqfile.c * \brief Implements parsing of CCL qualifier specs in files */ +#if HAVE_CONFIG_H +#include +#endif #include #include @@ -79,14 +82,15 @@ int ccl_qual_field2(CCL_bibset bibset, const char *cp, const char *qual_name, /* lead is first of a list of qualifier aliaeses */ /* qualifier alias: q1 q2 ... */ char *qlist[10]; - int i = 0; + size_t i = 0; qlist[i++] = lead_str; - while ((t=yaz_tok_move(tp)) == YAZ_TOK_STRING) + while (t == YAZ_TOK_STRING) { if (i < sizeof(qlist)/sizeof(*qlist)-1) qlist[i++] = xstrdup(yaz_tok_parse_string(tp)); + t = yaz_tok_move(tp); } qlist[i] = 0; yaz_tok_parse_destroy(tp); @@ -154,6 +158,10 @@ int ccl_qual_field2(CCL_bibset bibset, const char *cp, const char *qual_name, value = CCL_BIB1_TRU_CAN_BOTH; else if (!ccl_stricmp (value_str, "n")) value = CCL_BIB1_TRU_CAN_NONE; + else if (!ccl_stricmp (value_str, "x")) + value = CCL_BIB1_TRU_CAN_REGEX; + else if (!ccl_stricmp (value_str, "z")) + value = CCL_BIB1_TRU_CAN_Z3958; break; case 'c': case 'C': @@ -239,7 +247,7 @@ void ccl_qual_buf(CCL_bibset bibset, const char *buf) while (1) { const char *cp2 = cp1; - int len; + size_t len; while (*cp2 && !strchr("\r\n", *cp2)) cp2++; len = cp2 - cp1; @@ -308,6 +316,7 @@ int ccl_qual_fname (CCL_bibset bibset, const char *fname) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab