removing the XSLT filter from the build, only keeping the ALVIS filter
[idzebra-moved-to-github.git] / recctrl / danbibr.c
index 6459d98..92e1d18 100644 (file)
@@ -1,6 +1,6 @@
-/* $Id: danbibr.c,v 1.4 2004-05-26 13:47:08 adam Exp $
-   Copyright (C) 2004
-   Index Data Aps
+/* $Id: danbibr.c,v 1.11 2006-05-10 08:13:28 adam Exp $
+   Copyright (C) 1995-2005
+   Index Data ApS
 
 This file is part of the Zebra server.
 
@@ -26,11 +26,9 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include <yaz/log.h>
 
-#include "grsread.h"
+#include <idzebra/recgrs.h>
 
 #include <yaz/xmalloc.h>
-#include <yaz/log.h>
-#include <data1.h>
 
 #define READ_CHUNK 200
 
@@ -39,7 +37,7 @@ struct danbibr_info {
     char read_buf[READ_CHUNK+1];  /* space for \0 */
 };
 
-static void *grs_init_danbib(void)
+static void *init_danbib(Res res, RecType rt)
 {
     struct danbibr_info *p = (struct danbibr_info *) xmalloc (sizeof(*p));
 
@@ -188,7 +186,7 @@ static data1_node *mk_tree(struct grs_read_info *p, const char *rec_buf)
     return root;
 }
 
-static data1_node *grs_read_danbib (struct grs_read_info *p)
+static data1_node *read_danbib (struct grs_read_info *p)
 {
     struct danbibr_info *info = p->clientData;
 
@@ -197,7 +195,7 @@ static data1_node *grs_read_danbib (struct grs_read_info *p)
     return 0;
 }
 
-static void grs_destroy_danbib(void *clientData)
+static void destroy_danbib(void *clientData)
 {
     struct danbibr_info *p = (struct danbibr_info *) clientData;
 
@@ -205,12 +203,46 @@ static void grs_destroy_danbib(void *clientData)
     xfree (p);
 }
 
-static struct recTypeGrs danbib_type = {
-    "danbib",
-    grs_init_danbib,
-    grs_destroy_danbib,
-    grs_read_danbib
+
+static int extract_danbib(void *clientData, struct recExtractCtrl *ctrl)
+{
+    return zebra_grs_extract(clientData, ctrl, read_danbib);
+}
+
+static int retrieve_danbib(void *clientData, struct recRetrieveCtrl *ctrl)
+{
+    return zebra_grs_retrieve(clientData, ctrl, read_danbib);
+}
+
+static struct recType danbib_type = {
+    0,
+    "grs.danbib",
+    init_danbib,
+    0,
+    destroy_danbib,
+    extract_danbib,
+    retrieve_danbib,
+};
+
+RecType
+#ifdef IDZEBRA_STATIC_GRS_DANBIB
+idzebra_filter_grs_danbib
+#else
+idzebra_filter
+#endif
+
+[] = {
+    &danbib_type,
+    0,
 };
+    
+
 
-RecTypeGrs recTypeGrs_danbib = &danbib_type;
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */