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
Not using the deprecated yaz-util.h any more
[idzebra-moved-to-github.git]
/
data1
/
d1_read.c
diff --git
a/data1/d1_read.c
b/data1/d1_read.c
index
c1e8860
..
f19b20e
100644
(file)
--- a/
data1/d1_read.c
+++ b/
data1/d1_read.c
@@
-1,4
+1,4
@@
-/* $Id: d1_read.c,v 1.7 2004-07-26 12:20:07 adam Exp $
+/* $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
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
@@
-29,10
+29,19
@@
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include <stdio.h>
#include <stdlib.h>
#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/xmalloc.h>
-#include <yaz/yaz-util.h>
-#include <yaz/log.h>
-#include <data1.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 <d1_absyn.h>
data1_node *data1_get_root_tag (data1_handle dh, data1_node *n)
{
data1_node *data1_get_root_tag (data1_handle dh, data1_node *n)
{
@@
-118,7
+127,7
@@
static void data1_init_node (data1_handle dh, data1_node *r, int type)
r->u.preprocess.attributes = 0;
break;
default:
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);
}
}
}
}
@@
-194,7
+203,7
@@
data1_node *data1_mk_root (data1_handle dh, NMEM nmem, const char *name)
data1_node *res;
if (!absyn)
{
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 */
}
name);
/* It's now OK for a record not to have an absyn */
}
@@
-301,14
+310,10
@@
data1_node *data1_mk_tag_n (data1_handle dh, NMEM nmem,
void data1_tag_add_attr (data1_handle dh, NMEM nmem,
data1_node *res, const char **attr)
{
void data1_tag_add_attr (data1_handle dh, NMEM nmem,
data1_node *res, const char **attr)
{
- data1_xattr **p;
-
if (res->which != DATA1N_tag)
return;
if (res->which != DATA1N_tag)
return;
- p = &res->u.tag.attributes;
- data1_add_attrs(dh, nmem, attr, p);
- *p = 0;
+ data1_add_attrs(dh, nmem, attr, &res->u.tag.attributes);
}
data1_node *data1_mk_tag (data1_handle dh, NMEM nmem,
}
data1_node *data1_mk_tag (data1_handle dh, NMEM nmem,
@@
-474,8
+479,8
@@
data1_node *data1_add_taggeddata (data1_handle dh, data1_node *root,
return data1_add_insert_taggeddata (dh, at, tagname, m, 1, 0);
}
return data1_add_insert_taggeddata (dh, at, tagname, m, 1, 0);
}
-data1_node *data1_mk_tag_data_int (data1_handle dh, data1_node *at,
- const char *tag, int num,
+data1_node *data1_mk_tag_data_zint (data1_handle dh, data1_node *at,
+ const char *tag, zint num,
NMEM nmem)
{
data1_node *node_data;
NMEM nmem)
{
data1_node *node_data;
@@
-485,11
+490,18
@@
data1_node *data1_mk_tag_data_int (data1_handle dh, data1_node *at,
return 0;
node_data->u.data.what = DATA1I_num;
node_data->u.data.data = node_data->lbuf;
return 0;
node_data->u.data.what = DATA1I_num;
node_data->u.data.data = node_data->lbuf;
- sprintf (node_data->u.data.data, "%d", num);
+ sprintf (node_data->u.data.data, ZINT_FORMAT, num);
node_data->u.data.len = strlen (node_data->u.data.data);
return node_data;
}
node_data->u.data.len = strlen (node_data->u.data.data);
return node_data;
}
+data1_node *data1_mk_tag_data_int (data1_handle dh, data1_node *at,
+ const char *tag, int num,
+ NMEM nmem)
+{
+ return data1_mk_tag_data_zint(dh, at, tag, num, nmem);
+}
+
data1_node *data1_mk_tag_data_oid (data1_handle dh, data1_node *at,
const char *tag, Odr_oid *oid,
NMEM nmem)
data1_node *data1_mk_tag_data_oid (data1_handle dh, data1_node *at,
const char *tag, Odr_oid *oid,
NMEM nmem)
@@
-783,7
+795,7
@@
data1_node *data1_read_nodex (data1_handle dh, NMEM m,
}
if (amp || c != '>')
{
}
if (amp || c != '>')
{
- yaz_log(LOG_WARN, "d1: %d: Malformed tag", line);
+ yaz_log(YLOG_WARN, "d1: %d: Malformed tag", line);
return 0;
}
else
return 0;
}
else
@@
-811,7
+823,7
@@
data1_node *data1_read_nodex (data1_handle dh, NMEM m,
}
if (i != level)
{
}
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;
}
line, tag);
break;
}
@@
-836,7
+848,7
@@
data1_node *data1_read_nodex (data1_handle dh, NMEM m,
if (sscanf(args, "%s %s %n", tclass, type, &val_offset) != 2)
{
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 =
continue;
}
if (!(tp =