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
Work on xpath-like queries
[idzebra-moved-to-github.git]
/
recctrl
/
marcread.c
diff --git
a/recctrl/marcread.c
b/recctrl/marcread.c
index
4afdd7a
..
b3f5190
100644
(file)
--- a/
recctrl/marcread.c
+++ b/
recctrl/marcread.c
@@
-3,7
+3,7
@@
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
- * $Id: marcread.c,v 1.13 2002-05-03 13:50:25 adam Exp $
+ * $Id: marcread.c,v 1.16 2002-07-05 12:43:30 adam Exp $
*/
#include <stdio.h>
#include <ctype.h>
*/
#include <stdio.h>
#include <ctype.h>
@@
-31,8
+31,7
@@
data1_node *grs_read_marc (struct grs_read_info *p)
#if MARC_DEBUG
FILE *outf = stdout;
#endif
#if MARC_DEBUG
FILE *outf = stdout;
#endif
-
- data1_node *res_root;
+ data1_node *res_root, *res_top;
char *absynName;
data1_marctab *marctab;
char *absynName;
data1_marctab *marctab;
@@
-66,6
+65,7
@@
data1_node *grs_read_marc (struct grs_read_info *p)
yaz_log (LOG_WARN, "cannot read MARC without an abstract syntax");
return 0;
}
yaz_log (LOG_WARN, "cannot read MARC without an abstract syntax");
return 0;
}
+ res_top = data1_mk_tag (p->dh, p->mem, absynName, 0, res_root);
marctab = res_root->u.root.absyn->marc;
marctab = res_root->u.root.absyn->marc;
@@
-94,7
+94,7
@@
data1_node *grs_read_marc (struct grs_read_info *p)
int i, i0;
char tag[4];
data1_node *res;
int i, i0;
char tag[4];
data1_node *res;
- data1_node *parent = res_root;
+ data1_node *parent = res_top;
memcpy (tag, buf+entry_p, 3);
entry_p += 3;
memcpy (tag, buf+entry_p, 3);
entry_p += 3;
@@
-102,7
+102,7
@@
data1_node *grs_read_marc (struct grs_read_info *p)
/* generate field node */
/* generate field node */
- res = data1_mk_tag_n (p->dh, p->mem, tag, 3, res_root);
+ res = data1_mk_tag_n (p->dh, p->mem, tag, 3, 0 /* attr */, parent);
#if MARC_DEBUG
fprintf (outf, "%s ", tag);
#if MARC_DEBUG
fprintf (outf, "%s ", tag);
@@
-121,7
+121,7
@@
data1_node *grs_read_marc (struct grs_read_info *p)
int j;
#endif
res = data1_mk_tag_n (p->dh, p->mem,
int j;
#endif
res = data1_mk_tag_n (p->dh, p->mem,
- buf+i, indicator_length, res);
+ buf+i, indicator_length, 0 /* attr */, res);
#if MARC_DEBUG
for (j = 0; j<indicator_length; j++)
fprintf (outf, "%c", buf[j+i]);
#if MARC_DEBUG
for (j = 0; j<indicator_length; j++)
fprintf (outf, "%c", buf[j+i]);
@@
-137,7
+137,8
@@
data1_node *grs_read_marc (struct grs_read_info *p)
{
data1_node *res =
data1_mk_tag_n (p->dh, p->mem,
{
data1_node *res =
data1_mk_tag_n (p->dh, p->mem,
- buf+i+1, identifier_length-1, parent);
+ buf+i+1, identifier_length-1,
+ 0 /* attr */, parent);
#if MARC_DEBUG
fprintf (outf, " $");
for (j = 1; j<identifier_length; j++)
#if MARC_DEBUG
fprintf (outf, " $");
for (j = 1; j<identifier_length; j++)
@@
-167,9
+168,7
@@
data1_node *grs_read_marc (struct grs_read_info *p)
}
if (i > i0)
{
}
if (i > i0)
{
- data1_node *res = data1_mk_tag_n (p->dh, p->mem,
- "@", 1, parent);
- data1_mk_text_n (p->dh, p->mem, buf + i0, i - i0, res);
+ data1_mk_text_n (p->dh, p->mem, buf + i0, i - i0, parent);
}
#if MARC_DEBUG
fprintf (outf, "\n");
}
#if MARC_DEBUG
fprintf (outf, "\n");