/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2009 Index Data
+ * Copyright (C) 1995-2011 Index Data
* See the file LICENSE for details.
*/
-
/**
* \file cqlutil.c
* \brief Implements CQL tree node utilities.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdlib.h>
#include <string.h>
return p;
}
+struct cql_node *cql_node_mk_sort(NMEM nmem, const char *index,
+ struct cql_node *modifiers)
+{
+ struct cql_node *p = (struct cql_node *) nmem_malloc(nmem, sizeof(*p));
+ p->which = CQL_NODE_SORT;
+ p->u.sort.index = 0;
+ if (index)
+ p->u.sort.index = nmem_strdup(nmem, index);
+ p->u.sort.modifiers = modifiers;
+ p->u.sort.next = 0;
+ return p;
+}
+
const char *cql_uri(void)
{
return "info:srw/cql-context-set/1/cql-v1.2";
cql_node_destroy(cn->u.boolean.left);
cql_node_destroy(cn->u.boolean.right);
cql_node_destroy(cn->u.boolean.modifiers);
+ break;
+ case CQL_NODE_SORT:
+ cql_node_destroy(cn->u.sort.search);
+ cql_node_destroy(cn->u.sort.next);
+ cql_node_destroy(cn->u.sort.modifiers);
}
}
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab