-/* $Id: d1_read.c,v 1.9 2004-08-04 08:35:22 adam 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>
-#include <yaz/xmalloc.h>
#include <yaz/yaz-util.h>
-#include <yaz/log.h>
-#include <data1.h>
+#include <d1_absyn.h>
data1_node *data1_get_root_tag (data1_handle dh, data1_node *n)
{
r->u.preprocess.attributes = 0;
break;
default:
- logf (LOG_WARN, "data_mk_node_type. bad type = %d\n", type);
+ yaz_log (YLOG_WARN, "data_mk_node_type. bad type = %d\n", type);
}
}
data1_node *res;
if (!absyn)
{
- yaz_log(LOG_WARN, "Unable to acquire abstract syntax " "for '%s'",
+ yaz_log(YLOG_WARN, "Unable to acquire abstract syntax " "for '%s'",
name);
/* It's now OK for a record not to have an absyn */
}
}
if (amp || c != '>')
{
- yaz_log(LOG_WARN, "d1: %d: Malformed tag", line);
+ yaz_log(YLOG_WARN, "d1: %d: Malformed tag", line);
return 0;
}
else
}
if (i != level)
{
- yaz_log (LOG_WARN, "%d: no begin tag for %s",
+ yaz_log (YLOG_WARN, "%d: no begin tag for %s",
line, tag);
break;
}
if (sscanf(args, "%s %s %n", tclass, type, &val_offset) != 2)
{
- yaz_log(LOG_WARN, "Malformed variant triple at '%s'", tag);
+ yaz_log(YLOG_WARN, "Malformed variant triple at '%s'", tag);
continue;
}
if (!(tp =
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;
}