-/* $Id: zebramap.c,v 1.46 2006-03-28 12:39:08 adam Exp $
- Copyright (C) 1995-2005
+/* $Id: zebramap.c,v 1.49 2006-05-19 13:49:38 adam Exp $
+ Copyright (C) 1995-2006
Index Data ApS
This file is part of the Zebra server.
#include <ctype.h>
#include <charmap.h>
+#include <attrfind.h>
#include <yaz/yaz-util.h>
#include <idzebra/zebramap.h>
}
-/* ------------------------------------ */
-
-typedef struct {
- int type;
- int major;
- int minor;
- Z_AttributeElement **attributeList;
- int num_attributes;
-} AttrType;
-
-static int attr_find(AttrType *src, oid_value *attributeSetP)
-{
- while (src->major < src->num_attributes)
- {
- Z_AttributeElement *element;
-
- element = src->attributeList[src->major];
- if (src->type == *element->attributeType)
- {
- switch (element->which)
- {
- case Z_AttributeValue_numeric:
- ++(src->major);
- if (element->attributeSet && attributeSetP)
- {
- oident *attrset;
-
- attrset = oid_getentbyoid(element->attributeSet);
- *attributeSetP = attrset->value;
- }
- return *element->value.numeric;
- break;
- case Z_AttributeValue_complex:
- if (src->minor >= element->value.complex->num_list ||
- element->value.complex->list[src->minor]->which !=
- Z_StringOrNumeric_numeric)
- break;
- ++(src->minor);
- if (element->attributeSet && attributeSetP)
- {
- oident *attrset;
-
- attrset = oid_getentbyoid(element->attributeSet);
- *attributeSetP = attrset->value;
- }
- return *element->value.complex->list[src->minor-1]->u.numeric;
- default:
- assert(0);
- }
- }
- ++(src->major);
- }
- return -1;
-}
-
-static void attr_init_APT(AttrType *src, Z_AttributesPlusTerm *zapt, int type)
-{
- src->attributeList = zapt->attributes->attributes;
- src->num_attributes = zapt->attributes->num_attributes;
- src->type = type;
- src->major = 0;
- src->minor = 0;
-}
-
-static void attr_init_AttrList(AttrType *src, Z_AttributeList *list, int type)
-{
- src->attributeList = list->attributes;
- src->num_attributes = list->num_attributes;
- src->type = type;
- src->major = 0;
- src->minor = 0;
-}
/* ------------------------------------ */
if (relation_value == 103)
{
*search_type = "always";
+ *reg_id = 'w';
return 0;
}
if (*complete_flag)
return zms->wrbuf_1;
}
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+