From: Adam Dickmeiss Date: Thu, 27 Sep 2012 13:11:07 +0000 (+0200) Subject: Implement ccl_qual_fitem2 X-Git-Tag: v4.2.39~2 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=17118baaeff3d358a93d93aacfa46cef14ee5bab;p=yaz-moved-to-github.git Implement ccl_qual_fitem2 Like ccl_qual_fitem but with diagnostic string returned. --- diff --git a/include/yaz/ccl.h b/include/yaz/ccl.h index 88deaed..dbf73e4 100644 --- a/include/yaz/ccl.h +++ b/include/yaz/ccl.h @@ -223,6 +223,9 @@ void ccl_qual_line(CCL_bibset bibset, char *line); YAZ_EXPORT void ccl_qual_fitem(CCL_bibset bibset, const char *value, const char *qual_name); +YAZ_EXPORT +int ccl_qual_fitem2(CCL_bibset bibset, const char *value, + const char *qual_name, const char **addinfo); /** Make CCL qualifier set */ YAZ_EXPORT diff --git a/src/cclqfile.c b/src/cclqfile.c index 3d64a72..b4661b3 100644 --- a/src/cclqfile.c +++ b/src/cclqfile.c @@ -234,12 +234,24 @@ void ccl_qual_field(CCL_bibset bibset, const char *cp, const char *qual_name) yaz_log(YLOG_WARN, "ccl_qual_field2 fail: %s", addinfo); } -void ccl_qual_fitem (CCL_bibset bibset, const char *cp, const char *qual_name) +int ccl_qual_fitem2(CCL_bibset bibset, const char *cp, const char *qual_name, + const char **addinfo) { if (*qual_name == '@') + { + /* ccl_qual_add_special can not return error (yet) */ ccl_qual_add_special(bibset, qual_name+1, cp); + *addinfo = 0; + return 0; + } else - ccl_qual_field(bibset, cp, qual_name); + return ccl_qual_field2(bibset, cp, qual_name, addinfo); +} + +void ccl_qual_fitem(CCL_bibset bibset, const char *cp, const char *qual_name) +{ + const char *addinfo = 0; + ccl_qual_fitem2(bibset, cp, qual_name, &addinfo); } void ccl_qual_buf(CCL_bibset bibset, const char *buf)