X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=index%2Fxmlread.c;h=248342b004aa50229a3f5c96adae210d21c4270d;hp=3bb6da3696d80dec10c3b734b68f18e4e3f1a313;hb=78b13a3ac6a79768fb609c14db2a8e0c94a9c4da;hpb=4478d785b7769691261005c98063b98a5a5971b3 diff --git a/index/xmlread.c b/index/xmlread.c index 3bb6da3..248342b 100644 --- a/index/xmlread.c +++ b/index/xmlread.c @@ -1,8 +1,5 @@ -/* $Id: xmlread.c,v 1.2 2006-08-14 10:40:15 adam Exp $ - Copyright (C) 1995-2006 - Index Data ApS - -This file is part of the Zebra server. +/* This file is part of the Zebra server. + Copyright (C) 1995-2008 Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -156,11 +153,11 @@ static void cb_entity_decl (void *userData, const char *entityName, } -static int cb_external_entity (XML_Parser pparser, - const char *context, - const char *base, - const char *systemId, - const char *publicId) +static int cb_external_entity(XML_Parser pparser, + const char *context, + const char *base, + const char *systemId, + const char *publicId) { struct user_info *ui = (struct user_info*) XML_GetUserData(pparser); FILE *inf; @@ -392,9 +389,10 @@ static void cb_ns_end(void *userData, const char *prefix) if (prefix) yaz_log(ui->loglevel, "cb_ns_end %s", prefix); } -data1_node *zebra_read_xml (data1_handle dh, - int (*rf)(void *, char *, size_t), void *fh, - NMEM m) + +data1_node *zebra_read_xml(data1_handle dh, + struct ZebraRecStream *stream, + NMEM m) { XML_Parser parser; struct user_info uinfo; @@ -434,7 +432,7 @@ data1_node *zebra_read_xml (data1_handle dh, yaz_log (YLOG_WARN, "XML_GetBuffer fail"); break; } - r = (*rf)(fh, buf, XML_CHUNK); + r = stream->readf(stream, buf, XML_CHUNK); if (r < 0) { /* error */ @@ -484,9 +482,9 @@ struct xml_info { XML_Expat_Version expat_version; }; -static data1_node *grs_read_xml (struct grs_read_info *p) +static data1_node *grs_read_xml(struct grs_read_info *p) { - return zebra_read_xml (p->dh, p->readf, p->fh, p->mem); + return zebra_read_xml(p->dh, p->stream, p->mem); } static void *filter_init(Res res, RecType recType)