-/* $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
#include <yaz/log.h>
-#include "grsread.h"
+#include <idzebra/recgrs.h>
#include <yaz/xmalloc.h>
#include <yaz/log.h>
-#include <data1.h>
#include <expat.h>
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));
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