-/* $Id: d1_absyn.c,v 1.31 2006-10-26 23:49:14 adam Exp $
- Copyright (C) 1995-2006
- Index Data ApS
-
-This file is part of the Zebra server.
+/* This file is part of the Zebra server.
+ Copyright (C) 1995-2008 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
#include <string.h>
#include <yaz/log.h>
-#include <yaz/oid.h>
+#include <yaz/oid_db.h>
#include <idzebra/data1.h>
#include <idzebra/recctrl.h>
#include <zebra_xpath.h>
return 0;
}
-data1_attset *data1_attset_search_id (data1_handle dh, int id)
+data1_attset *data1_attset_search_id(data1_handle dh, const Odr_oid *oid)
{
data1_attset_cache p = *data1_attset_cache_get (dh);
while (p)
{
- if (id == p->attset->reference)
+ if (p->attset->oid && !oid_oidcmp(oid, p->attset->oid))
return p->attset;
p = p->next;
}
res = (data1_absyn *) nmem_malloc(data1_nmem_get(dh), sizeof(*res));
res->name = 0;
- res->reference = VAL_NONE;
+ res->oid = 0;
res->tagset = 0;
res->encoding = 0;
res->xpath_indexing =
data1_xpelement *xp_ele = 0;
data1_xpelement *last_match = 0;
- if (argc < 3)
+ if (argc != 3)
{
- yaz_log(YLOG_WARN, "%s:%d: Bad # of args to xelm", file, lineno);
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args to %s",
+ file, lineno, cmd);
continue;
}
continue;
}
name = argv[1];
- if ((res->reference = oid_getvalbyname(name)) == VAL_NONE)
+ res->oid = yaz_string_to_oid_nmem(yaz_oid_std(),
+ CLASS_SCHEMA, name,
+ data1_nmem_get(dh));
+ if (!res->oid)
{
yaz_log(YLOG_WARN, "%s:%d: Unknown tagset ref '%s'",
file, lineno, name);
*systagsp = 0;
return res;
}
+
/*
* Local variables:
* c-basic-offset: 4