From 17118baaeff3d358a93d93aacfa46cef14ee5bab Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 27 Sep 2012 15:11:07 +0200 Subject: [PATCH] Implement ccl_qual_fitem2 Like ccl_qual_fitem but with diagnostic string returned. --- include/yaz/ccl.h | 3 +++ src/cclqfile.c | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) 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) -- 1.7.10.4