-/* $Id: d1_absyn.c,v 1.37 2007-10-28 18:41:08 adam Exp $
- Copyright (C) 1995-2007
- Index Data ApS
-
-This file is part of the Zebra server.
+/* This file is part of the Zebra server.
+ Copyright (C) 2004-2013 Index Data
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
void *data1_hash_lookup(struct data1_hash_table *ht, const char *str)
{
struct data1_hash_entry **he = &ht->ar[data1_hash_calc(ht, str)];
void *data1_hash_lookup(struct data1_hash_table *ht, const char *str)
{
struct data1_hash_entry **he = &ht->ar[data1_hash_calc(ht, str)];
data1_xpelement *xpe = abs->xp_elements;
while (xpe) {
yaz_log (YLOG_DEBUG,"Destroy xp element %s",xpe->xpath_expr);
data1_xpelement *xpe = abs->xp_elements;
while (xpe) {
yaz_log (YLOG_DEBUG,"Destroy xp element %s",xpe->xpath_expr);
attset = data1_read_attset (dh, name);
if (!attset)
yaz_log (YLOG_WARN|YLOG_ERRNO, "Couldn't load attribute set %s", name);
attset = data1_read_attset (dh, name);
if (!attset)
yaz_log (YLOG_WARN|YLOG_ERRNO, "Couldn't load attribute set %s", name);
data1_attset_cache p = (data1_attset_cache)
nmem_malloc (mem, sizeof(*p));
data1_attset_cache *pp = data1_attset_cache_get (dh);
data1_attset_cache p = (data1_attset_cache)
nmem_malloc (mem, sizeof(*p));
data1_attset_cache *pp = data1_attset_cache_get (dh);
for (n = r->tag->names; n; n = n->next)
data1_hash_insert(ht, n->name, r, 0);
}
for (n = r->tag->names; n; n = n->next)
data1_hash_insert(ht, n->name, r, 0);
}
source = "data"; /* ok: default is leaf data */
(*tp)->source = (char *)
nmem_strdup (data1_nmem_get (dh), source);
source = "data"; /* ok: default is leaf data */
(*tp)->source = (char *)
nmem_strdup (data1_nmem_get (dh), source);
(*tp)->structure = (char *)
nmem_strdup (data1_nmem_get (dh), structure);
tp = &(*tp)->next;
(*tp)->structure = (char *)
nmem_strdup (data1_nmem_get (dh), structure);
tp = &(*tp)->next;
else
fieldtype = "datafield";
sprintf(buf, "/*/%s[@tag=\"%s\"]", fieldtype, field);
else
fieldtype = "datafield";
sprintf(buf, "/*/%s[@tag=\"%s\"]", fieldtype, field);
sprintf(buf + strlen(buf), "/subfield[@code=\"%s\"]", subfield);
else if (field[0] != '0' || field[1] != '0')
strcat(buf, "/subfield");
sprintf(buf + strlen(buf), "/subfield[@code=\"%s\"]", subfield);
else if (field[0] != '0' || field[1] != '0')
strcat(buf, "/subfield");
char *argv[50], line[512];
f = data1_path_fopen(dh, file, "r");
char *argv[50], line[512];
f = data1_path_fopen(dh, file, "r");
cur_elements->elements = NULL;
cur_elements->name = "main";
res->sub_elements = cur_elements;
cur_elements->elements = NULL;
cur_elements->name = "main";
res->sub_elements = cur_elements;
tp = &new_element->termlists;
ppl[level-1] = &new_element->next;
ppl[level] = &new_element->children;
tp = &new_element->termlists;
ppl[level-1] = &new_element->next;
ppl[level] = &new_element->children;
/* consider subtree (if any) ... */
if ((sub_p = strchr (p, ':')) && sub_p[1])
{
*sub_p++ = '\0';
new_element->sub_name =
/* consider subtree (if any) ... */
if ((sub_p = strchr (p, ':')) && sub_p[1])
{
*sub_p++ = '\0';
new_element->sub_name =
}
/* well-defined tag */
if (sscanf(p, "(%d,%d)", &type, &value) == 2)
}
/* well-defined tag */
if (sscanf(p, "(%d,%d)", &type, &value) == 2)
nt->which = DATA1T_string;
nt->value.string = nmem_strdup(data1_nmem_get (dh), p);
nt->names = (data1_name *)
nt->which = DATA1T_string;
nt->value.string = nmem_strdup(data1_nmem_get (dh), p);
nt->names = (data1_name *)
/* *ostrich*
New code to support xelm directive
for each xelm a dfa is built. xelms are stored in res->xp_elements
/* *ostrich*
New code to support xelm directive
for each xelm a dfa is built. xelms are stored in res->xp_elements
(*cur_xpelement)->xpath, XPATH_STEP_COUNT,
data1_nmem_get(dh));
#endif
(*cur_xpelement)->termlists = 0;
tp = &(*cur_xpelement)->termlists;
(*cur_xpelement)->xpath, XPATH_STEP_COUNT,
data1_nmem_get(dh));
#endif
(*cur_xpelement)->termlists = 0;
tp = &(*cur_xpelement)->termlists;
cur_elements = (data1_sub_elements *)
nmem_malloc(data1_nmem_get(dh), sizeof(*cur_elements));
cur_elements->next = res->sub_elements;
cur_elements->elements = NULL;
cur_elements->name = nmem_strdup (data1_nmem_get(dh), name);
res->sub_elements = cur_elements;
cur_elements = (data1_sub_elements *)
nmem_malloc(data1_nmem_get(dh), sizeof(*cur_elements));
cur_elements->next = res->sub_elements;
cur_elements->elements = NULL;
cur_elements->name = nmem_strdup (data1_nmem_get(dh), name);
res->sub_elements = cur_elements;
*esetpp = (data1_esetname *)
nmem_malloc(data1_nmem_get(dh), sizeof(**esetpp));
(*esetpp)->name = nmem_strdup(data1_nmem_get(dh), name);
*esetpp = (data1_esetname *)
nmem_malloc(data1_nmem_get(dh), sizeof(**esetpp));
(*esetpp)->name = nmem_strdup(data1_nmem_get(dh), name);
- yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'", file,
+ yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'", file,