-/* $Id: d1_doespec.c,v 1.9 2006-05-10 08:13:18 adam Exp $
+/* $Id: d1_doespec.c,v 1.10 2006-07-06 11:40:23 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
}
if (remove_flag)
{
- data1_free_tree (dh, *c);
*c = (*c)->next;
}
else
-/* $Id: d1_map.c,v 1.11 2006-06-13 12:02:02 adam Exp $
+/* $Id: d1_map.c,v 1.12 2006-07-06 11:40:23 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
if (map_children(dh, n, map, res1, m) < 0)
{
- data1_free_tree(dh, res);
return 0;
}
return res;
-/* $Id: d1_read.c,v 1.19 2006-06-13 12:02:02 adam Exp $
+/* $Id: d1_read.c,v 1.20 2006-07-06 11:40:23 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
{
data1_node *r = (data1_node *)nmem_malloc(m, sizeof(*r));
r->next = r->child = r->last_child = 0;
- r->destroy = 0;
r->parent = parent;
if (!parent)
{
data1_node *r = (data1_node *)nmem_malloc(m, sizeof(*r));
r->next = r->child = r->last_child = 0;
- r->destroy = 0;
if (!parent)
r->root = r;
return r;
}
-void data1_free_tree (data1_handle dh, data1_node *t)
-{
- data1_node *p = t->child, *pn;
-
- while (p)
- {
- pn = p->next;
- data1_free_tree (dh, p);
- p = pn;
- }
- if (t->destroy)
- (*t->destroy)(t);
-}
-
data1_node *data1_mk_root (data1_handle dh, NMEM nmem, const char *name)
{
data1_absyn *absyn = data1_get_absyn(dh, name, 1);
-/* $Id: data1.h,v 1.15 2006-06-13 12:02:03 adam Exp $
+/* $Id: data1.h,v 1.16 2006-07-06 11:40:24 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
} preprocess;
} u;
- void (*destroy)(struct data1_node *n);
#define DATA1_LOCALDATA 12
char lbuf[DATA1_LOCALDATA]; /* small buffer for local data */
struct data1_node *next;
int *len);
YAZ_EXPORT data1_tag *data1_gettagbyname(data1_handle dh, data1_tagset *s,
const char *name);
-YAZ_EXPORT void data1_free_tree(data1_handle dh, data1_node *t);
YAZ_EXPORT char *data1_nodetobuf(data1_handle dh, data1_node *n,
int select, int *len);
YAZ_EXPORT data1_node *data1_mk_tag_data_wd(data1_handle dh,
-/* $Id: recgrs.c,v 1.1 2006-07-03 14:27:09 adam Exp $
+/* $Id: recgrs.c,v 1.2 2006-07-06 11:40:25 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
(*p->init)(p, &wrd);
if (dumpkeys(n, p, &wrd) < 0)
{
- data1_free_tree(p->dh, n);
return RECCTRL_EXTRACT_ERROR_GENERIC;
}
- data1_free_tree(p->dh, n);
return RECCTRL_EXTRACT_OK;
}
p->odr)) > 0)
{
p->diagnostic = res;
- if (onode)
- data1_free_tree(p->dh, onode);
- data1_free_tree(p->dh, node);
nmem_destroy(mem);
return 0;
}
p->rec_buf = new_buf;
}
}
- if (node)
- data1_free_tree(p->dh, node);
- if (onode)
- data1_free_tree(p->dh, onode);
nmem_destroy(mem);
return 0;
}