X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fsrw.c;h=edb574113f3b808ef6693160106c80ee120e29fb;hb=97554b23cfc19394bb77f7f3c4bf0c8abf89297b;hp=9fdadce1de898466e2e3e56f37a22fd218892068;hpb=4b7f94b22a4a670274c028db7f0e438f2d7d74a0;p=yaz-moved-to-github.git diff --git a/src/srw.c b/src/srw.c index 9fdadce..edb5741 100644 --- a/src/srw.c +++ b/src/srw.c @@ -2,7 +2,7 @@ * Copyright (c) 2002-2004, Index Data. * See the file LICENSE for details. * - * $Id: srw.c,v 1.20 2004-01-27 21:22:44 adam Exp $ + * $Id: srw.c,v 1.21 2004-02-14 15:58:42 adam Exp $ */ #include @@ -285,7 +285,7 @@ static int yaz_srw_diagnostics(ODR o, xmlNodePtr pptr, Z_SRW_diagnostic **recs, *recs = odr_malloc(o, *num * sizeof(**recs)); for (i = 0; i < *num; i++) { - (*recs)[i].code = 0; + (*recs)[i].uri = 0; (*recs)[i].details = 0; (*recs)[i].message = 0; } @@ -295,13 +295,13 @@ static int yaz_srw_diagnostics(ODR o, xmlNodePtr pptr, Z_SRW_diagnostic **recs, !strcmp(ptr->name, "diagnostic")) { xmlNodePtr rptr; - (*recs)[i].code = 0; + (*recs)[i].uri = 0; (*recs)[i].details = 0; (*recs)[i].message = 0; for (rptr = ptr->children; rptr; rptr = rptr->next) { - if (match_xsd_string(rptr, "code", o, - &(*recs)[i].code)) + if (match_xsd_string(rptr, "uri", o, + &(*recs)[i].uri)) ; else if (match_xsd_string(rptr, "details", o, &(*recs)[i].details)) @@ -323,13 +323,13 @@ static int yaz_srw_diagnostics(ODR o, xmlNodePtr pptr, Z_SRW_diagnostic **recs, { const char *std_diag = "info:srw/diagnostic/1/"; xmlNodePtr rptr = xmlNewChild(pptr, ns_diag, "diagnostic", 0); - add_xsd_string(rptr, "code", (*recs)[i].code); + add_xsd_string(rptr, "uri", (*recs)[i].uri); if ((*recs)[i].message) add_xsd_string(rptr, "message", (*recs)[i].message); - else if ((*recs)[i].code && - !strncmp((*recs)[i].code, std_diag, strlen(std_diag))) + else if ((*recs)[i].uri && + !strncmp((*recs)[i].uri, std_diag, strlen(std_diag))) { - int no = atoi((*recs)[i].code + strlen(std_diag)); + int no = atoi((*recs)[i].uri + strlen(std_diag)); const char *message = yaz_diag_srw_str(no); if (message) add_xsd_string(rptr, "message", message);