-/* $Id: d1_read.c,v 1.12 2004-12-10 11:56:21 heikki Exp $
- Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
- Index Data Aps
+/* $Id: d1_read.c,v 1.15 2005-01-17 22:12:34 adam Exp $
+ Copyright (C) 1995-2005
+ Index Data ApS
This file is part of the Zebra server.
#include <stdio.h>
#include <stdlib.h>
-/* Old yaz-util includes (FIXME - clean up what is not needed)*/
-#include <yaz/yconfig.h>
-#include <yaz/yaz-version.h>
-#include <yaz/xmalloc.h>
-#include <yaz/ylog.h>
-#include <yaz/tpath.h>
-#include <yaz/options.h>
-#include <yaz/wrbuf.h>
-#include <yaz/nmem.h>
-#include <yaz/readconf.h>
-#include <yaz/marcdisp.h>
-#include <yaz/yaz-iconv.h>
+#include <yaz/yaz-util.h>
#include <d1_absyn.h>
data1_node *data1_get_root_tag (data1_handle dh, data1_node *n)
if (yaz_matchstr (tocode, fromcode))
{
WRBUF wrbuf = wrbuf_alloc();
- yaz_iconv_t t = yaz_iconv_open (tocode, fromcode);
+ yaz_iconv_t t = yaz_iconv_open(tocode, fromcode);
if (!t)
+ {
+ wrbuf_free(wrbuf, 1);
return -1;
- data1_iconv_s (dh, m, n, t, wrbuf, tocode);
- yaz_iconv_close (t);
- wrbuf_free (wrbuf, 1);
+ }
+ data1_iconv_s(dh, m, n, t, wrbuf, tocode);
+ yaz_iconv_close(t);
+ wrbuf_free(wrbuf, 1);
}
return 0;
}