X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=recctrl%2Fxmlread.c;h=a5bd0069d547652efe8d5c6f95372fb26e38cdfc;hb=e172ced0dcc937dfc433a33c7e20962b9e6b5ea0;hp=d1403230a208c2776876ef83e902001a64a83bc8;hpb=3ea3705496f9f810982061713c6af941eee4c35e;p=idzebra-moved-to-github.git diff --git a/recctrl/xmlread.c b/recctrl/xmlread.c index d140323..a5bd006 100644 --- a/recctrl/xmlread.c +++ b/recctrl/xmlread.c @@ -1,4 +1,4 @@ -/* $Id: xmlread.c,v 1.13 2004-08-11 13:36:13 adam Exp $ +/* $Id: xmlread.c,v 1.15 2004-09-28 10:15:03 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -32,11 +32,10 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include -#include "grsread.h" +#include #include #include -#include #include @@ -480,7 +479,12 @@ struct xml_info { XML_Expat_Version expat_version; }; -static void *grs_init_xml(void) +static data1_node *grs_read_xml (struct grs_read_info *p) +{ + return zebra_read_xml (p->dh, p->readf, p->fh, p->mem); +} + +static void *init_xml(Res res, RecType recType) { struct xml_info *p = (struct xml_info *) xmalloc (sizeof(*p)); @@ -489,27 +493,43 @@ static void *grs_init_xml(void) return p; } -static data1_node *grs_read_xml (struct grs_read_info *p) +static void destroy_xml(void *clientData) { - return zebra_read_xml (p->dh, p->readf, p->fh, p->mem); + struct xml_info *p = (struct xml_info *) clientData; + + xfree (p); } -static void grs_destroy_xml(void *clientData) +static int extract_xml(void *clientData, struct recExtractCtrl *ctrl) { - struct xml_info *p = (struct xml_info *) clientData; + return zebra_grs_extract(clientData, ctrl, grs_read_xml); +} - xfree (p); +static int retrieve_xml(void *clientData, struct recRetrieveCtrl *ctrl) +{ + return zebra_grs_retrieve(clientData, ctrl, grs_read_xml); } -static struct recTypeGrs xml_type = { - "xml", - grs_init_xml, - grs_destroy_xml, - grs_read_xml +static struct recType xml_type = { + "grs.xml", + init_xml, + 0, + destroy_xml, + extract_xml, + retrieve_xml, }; -RecTypeGrs recTypeGrs_xml = &xml_type; +RecType +#ifdef IDZEBRA_STATIC_GRS_XML +idzebra_filter_grs_xml +#else +idzebra_filter +#endif -/* HAVE_EXPAT_H */ +[] = { + &xml_type, + 0, +}; + #endif