+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2010 Index Data
+ * See the file LICENSE for details.
+ */
+/**
+ * \file facet.c
+ * \brief Facet utilities
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <yaz/facet.h>
#include <yaz/diagbib1.h>
/* Gets the first string, there is usually only one */
/* in case of errors, returns null */
-void facet_struct_init(struct attrvalues *attr_values) {
+void facet_struct_init(struct yaz_facet_attr *attr_values) {
attr_values->errcode = 0;
attr_values->errstring = 0;
attr_values->relation = 0;
/* Use attribute, @attr1, can be numeric or string */
void useattr ( Z_AttributeElement *ae,
- struct attrvalues *av )
+ struct yaz_facet_attr *av )
{
const char *s;
if ( ae->which == Z_AttributeValue_complex ) {
/* TODO rename to sortorder attr */
void relationattr ( Z_AttributeElement *ae,
- struct attrvalues *av )
+ struct yaz_facet_attr *av )
{
if ( ae->which == Z_AttributeValue_numeric ) {
if ( *ae->value.numeric == 0 )
} /* relationattr */
void limitattr ( Z_AttributeElement *ae,
- struct attrvalues *av )
+ struct yaz_facet_attr *av )
{
/* TODO - check numeric first, then value! */
if ( ae->which == Z_AttributeValue_numeric ) {
av->limit = *ae->value.numeric;
+ yaz_log(YLOG_DEBUG, "limitattr %d ", av->limit);
} else {
av->errcode = YAZ_BIB1_UNSUPP_ATTRIBUTE;
av->errstring = "non-numeric limit attribute";
*/
void facetattrs( Z_AttributeList *attributes,
- struct attrvalues *av )
+ struct yaz_facet_attr *av )
{
int i;
Z_AttributeElement *ae;
list->elements[index] = field;
}
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+