-/* $Id: d1_absyn.c,v 1.30 2006-09-29 10:02:45 adam Exp $
+/* $Id: d1_absyn.c,v 1.31 2006-10-26 23:49:14 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
return argc;
}
-data1_marctab *data1_absyn_getmarctab(data1_handle dh, data1_absyn *absyn)
+data1_marctab *data1_absyn_getmarctab(data1_handle dh, data1_node *root)
{
- return absyn->marc;
+ if (root->u.root.absyn)
+ return root->u.root.absyn->marc;
+ return 0;
}
-YAZ_EXPORT data1_element *data1_absyn_getelements(data1_handle dh,
- data1_absyn *absyn)
+data1_element *data1_absyn_getelements(data1_handle dh,
+ data1_node *root)
{
- return absyn->main_elements;
+ if (root->u.root.absyn)
+ return root->u.root.absyn->main_elements;
+ return 0;
}
static data1_absyn *data1_read_absyn(data1_handle dh, const char *file,
-/* $Id: data1.h,v 1.18 2006-08-14 10:40:14 adam Exp $
+/* $Id: data1.h,v 1.19 2006-10-26 23:49:14 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
YAZ_EXPORT data1_marctab *data1_read_marctab (data1_handle dh,
const char *file);
YAZ_EXPORT data1_marctab *data1_absyn_getmarctab(data1_handle dh,
- data1_absyn *absyn);
+ data1_node *root);
YAZ_EXPORT data1_element *data1_absyn_getelements(data1_handle dh,
- data1_absyn *absyn);
+ data1_node *root);
YAZ_EXPORT char *data1_nodetomarc(data1_handle dh, data1_marctab *p,
data1_node *n, int selected, int *len);
YAZ_EXPORT char *data1_nodetoidsgml(data1_handle dh, data1_node *n,
-/* $Id: marcread.c,v 1.4 2006-10-12 10:13:33 adam Exp $
+/* $Id: marcread.c,v 1.5 2006-10-26 23:49:14 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
else
res_top = data1_mk_tag (p->dh, p->mem, absynName, 0, res_root);
- if ((marctab = data1_absyn_getmarctab(p->dh, res_root->u.root.absyn)))
+ if ((marctab = data1_absyn_getmarctab(p->dh, res_root)))
{
memcpy(marctab->leader, buf, 24);
memcpy(marctab->implementation_codes, buf+6, 4);
static void parse_data1_tree(struct grs_read_info *p, const char *mc_stmnt,
data1_node *root)
{
- data1_marctab *marctab = data1_absyn_getmarctab(p->dh, root->u.root.absyn);
+ data1_marctab *marctab = data1_absyn_getmarctab(p->dh, root);
data1_node *top = root->child;
data1_node *field;
mc_context *c;
if (!root)
return 0;
- for (e = data1_absyn_getelements(p->dh, root->u.root.absyn); e; e=e->next)
+ for (e = data1_absyn_getelements(p->dh, root); e; e=e->next)
{
data1_tag *tag = e->tag;
if (!root)
return 0;
- for (e = data1_absyn_getelements(p->dh, root->u.root.absyn); e; e=e->next)
+ for (e = data1_absyn_getelements(p->dh, root); e; e=e->next)
{
data1_tag *tag = e->tag;