First code bits of record retrieval code
[yaz-moved-to-github.git] / src / record_conv.c
index e392e61..2a60f21 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2005-2006, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: record_conv.c,v 1.2 2006-05-03 13:04:46 adam Exp $
+ * $Id: record_conv.c,v 1.4 2006-05-04 20:00:45 adam Exp $
  */
 /**
  * \file record_conv.c
 
 /** \brief The internal structure for yaz_record_conv_t */
 struct yaz_record_conv_struct {
-    /** memory for configuration */
+    /** \brief memory for configuration */
     NMEM nmem;
 
-    /** conversion rules (allocated using NMEM) */
+    /** \brief conversion rules (allocated using NMEM) */
     struct yaz_record_conv_rule *rules;
 
-    /** pointer to last conversion rule pointer in chain */
+    /** \brief pointer to last conversion rule pointer in chain */
     struct yaz_record_conv_rule **rules_p;
 
-    /** string buffer for error messages */
+    /** \brief string buffer for error messages */
     WRBUF wr_error;
 
-    /** path for opening files  */
+    /** \brief path for opening files  */
     char *path;
 };
 
@@ -54,6 +54,7 @@ enum YAZ_RECORD_CONV_RULE
     YAZ_RECORD_CONV_RULE_MARC
 };
 
+
 /** \brief tranformation info (rule info) */
 struct yaz_record_conv_rule {
     enum YAZ_RECORD_CONV_RULE which;
@@ -71,7 +72,7 @@ struct yaz_record_conv_rule {
     struct yaz_record_conv_rule *next;
 };
 
-/** reset rules+configuration */
+/** \brief reset rules+configuration */
 static void yaz_record_conv_reset(yaz_record_conv_t p)
 {
     struct yaz_record_conv_rule *r;
@@ -119,6 +120,7 @@ void yaz_record_conv_destroy(yaz_record_conv_t p)
     }
 }
 
+/** \brief adds a rule */
 static struct yaz_record_conv_rule *add_rule(yaz_record_conv_t p,
                                              enum YAZ_RECORD_CONV_RULE type)
 {
@@ -130,6 +132,7 @@ static struct yaz_record_conv_rule *add_rule(yaz_record_conv_t p,
     return r;
 }
 
+/** \brief parse 'xslt' conversion node */
 static int conv_xslt(yaz_record_conv_t p, const xmlNode *ptr)
 {
     struct _xmlAttr *attr;
@@ -178,6 +181,7 @@ static int conv_xslt(yaz_record_conv_t p, const xmlNode *ptr)
     return 0;
 }
 
+/** \brief parse 'marc' conversion node */
 static int conv_marc(yaz_record_conv_t p, const xmlNode *ptr)
 {
     struct _xmlAttr *attr;
@@ -427,25 +431,6 @@ int yaz_record_conv_record(yaz_record_conv_t p, const char *input_record,
     return ret;
 }
 
-#else
-/* !HAVE_XSLT */
-int yaz_record_conv_configure(yaz_record_conv_t p, const void *ptr_v)
-{
-    wrbuf_rewind(p->wr_error);
-    wrbuf_printf(p->wr_error, "No XML support: yaz_record_conv_configure");
-    return -1;
-}
-
-int yaz_record_conv_record(yaz_record_conv_t p, const char *input_record,
-                           WRBUF output_record);
-{
-    wrbuf_rewind(p->wr_error);
-    wrbuf_printf(p->wr_error, "No XML support: yaz_record_conv_record");
-    return -1;
-}
-
-#endif
-
 const char *yaz_record_conv_get_error(yaz_record_conv_t p)
 {
     return wrbuf_buf(p->wr_error);
@@ -453,14 +438,12 @@ const char *yaz_record_conv_get_error(yaz_record_conv_t p)
 
 void yaz_record_conv_set_path(yaz_record_conv_t p, const char *path)
 {
-    if (p)
-    {
-        xfree(p->path);
-        p->path = 0;
-        if (path)
-            p->path = xstrdup(path);
-    }
+    xfree(p->path);
+    p->path = 0;
+    if (path)
+        p->path = xstrdup(path);
 }
+#endif
 
 /*
  * Local variables: