projects
/
idzebra-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added a missing config file
[idzebra-moved-to-github.git]
/
recctrl
/
xmlread.c
diff --git
a/recctrl/xmlread.c
b/recctrl/xmlread.c
index
6bc8efa
..
a5bd006
100644
(file)
--- a/
recctrl/xmlread.c
+++ b/
recctrl/xmlread.c
@@
-1,4
+1,4
@@
-/* $Id: xmlread.c,v 1.12 2004-07-26 12:26:25 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
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 <yaz/log.h>
#include <yaz/log.h>
-#include "grsread.h"
+#include <idzebra/recgrs.h>
#include <yaz/xmalloc.h>
#include <yaz/log.h>
#include <yaz/xmalloc.h>
#include <yaz/log.h>
-#include <data1.h>
#include <expat.h>
#include <expat.h>
@@
-98,9
+97,11
@@
static void cb_decl (void *user, const char *version, const char *encoding,
data1_mk_preprocess (ui->dh, ui->nmem, "xml", attr_list,
ui->d1_stack[ui->level-1]);
data1_mk_preprocess (ui->dh, ui->nmem, "xml", attr_list,
ui->d1_stack[ui->level-1]);
+#if 0
yaz_log (LOG_LOG, "decl version=%s encoding=%s",
version ? version : "null",
encoding ? encoding : "null");
yaz_log (LOG_LOG, "decl version=%s encoding=%s",
version ? version : "null",
encoding ? encoding : "null");
+#endif
}
static void cb_processing (void *user, const char *target,
}
static void cb_processing (void *user, const char *target,
@@
-478,7
+479,12
@@
struct xml_info {
XML_Expat_Version expat_version;
};
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));
{
struct xml_info *p = (struct xml_info *) xmalloc (sizeof(*p));
@@
-487,27
+493,43
@@
static void *grs_init_xml(void)
return 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
#endif