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
Update for YAZ 3s new OID system
[idzebra-moved-to-github.git]
/
data1
/
d1_absyn.c
diff --git
a/data1/d1_absyn.c
b/data1/d1_absyn.c
index
4bf44b1
..
2f03b0c
100644
(file)
--- a/
data1/d1_absyn.c
+++ b/
data1/d1_absyn.c
@@
-1,4
+1,4
@@
-/* $Id: d1_absyn.c,v 1.33 2007-01-15 15:10:14 adam Exp $
+/* $Id: d1_absyn.c,v 1.35 2007-04-16 08:44:31 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
Copyright (C) 1995-2007
Index Data ApS
@@
-26,7
+26,7
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <string.h>
#include <yaz/log.h>
#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>
#include <idzebra/data1.h>
#include <idzebra/recctrl.h>
#include <zebra_xpath.h>
@@
-250,13
+250,13
@@
data1_attset *data1_attset_search_name (data1_handle dh, const char *name)
return 0;
}
return 0;
}
-data1_attset *data1_attset_search_id (data1_handle dh, int id)
+data1_attset *data1_attset_search_id(data1_handle dh, const int *oid)
{
data1_attset_cache p = *data1_attset_cache_get (dh);
while (p)
{
{
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;
}
return p->attset;
p = p->next;
}
@@
-700,10
+700,9
@@
static data1_absyn *data1_read_absyn(data1_handle dh, const char *file,
res = (data1_absyn *) nmem_malloc(data1_nmem_get(dh), sizeof(*res));
res->name = 0;
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->tagset = 0;
res->encoding = 0;
- res->staticrank = 0;
res->xpath_indexing =
(f ? DATA1_XPATH_INDEXING_DISABLE : default_xpath);
res->systags = 0;
res->xpath_indexing =
(f ? DATA1_XPATH_INDEXING_DISABLE : default_xpath);
res->systags = 0;
@@
-1023,7
+1022,10
@@
static data1_absyn *data1_read_absyn(data1_handle dh, const char *file,
continue;
}
name = argv[1];
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);
{
yaz_log(YLOG_WARN, "%s:%d: Unknown tagset ref '%s'",
file, lineno, name);
@@
-1183,18
+1185,6
@@
static data1_absyn *data1_read_absyn(data1_handle dh, const char *file,
(*systagsp)->value = nmem_strdup(data1_nmem_get(dh), argv[2]);
systagsp = &(*systagsp)->next;
}
(*systagsp)->value = nmem_strdup(data1_nmem_get(dh), argv[2]);
systagsp = &(*systagsp)->next;
}
- else if (!strcmp(cmd, "staticrank"))
- {
- if (argc != 2)
- {
- yaz_log(YLOG_WARN, "%s:%d: Bad # or args for staticrank",
- file, lineno);
- }
- else
- {
- res->staticrank = nmem_strdup(data1_nmem_get(dh), argv[1]);
- }
- }
else
{
yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'", file,
else
{
yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'", file,
@@
-1216,11
+1206,6
@@
static data1_absyn *data1_read_absyn(data1_handle dh, const char *file,
return res;
}
return res;
}
-YAZ_EXPORT const char *data1_absyn_get_staticrank(data1_absyn *absyn)
-{
- return absyn ? absyn->staticrank : 0;
-}
-
/*
* Local variables:
* c-basic-offset: 4
/*
* Local variables:
* c-basic-offset: 4