|
YAZ 5.35.1
|
CQL sortkeys utilities. More...
#include <assert.h>#include <stdlib.h>#include <string.h>#include <yaz/wrbuf.h>#include <yaz/cql.h>Go to the source code of this file.
Functions | |
| static void | pr_n (void(*pr)(const char *buf, void *client_data), const char *buf, int len, void *client_data) |
| static int | cql_sort_modifiers (struct cql_node *cn, void(*pr)(const char *buf, void *client_data), void *client_data) |
| int | cql_sortby_to_sortkeys (struct cql_node *cn, void(*pr)(const char *buf, void *client_data), void *client_data) |
| converts CQL sortby to sortkeys (ala versions 1.1) | |
| int | cql_sortby_to_sortkeys_buf (struct cql_node *cn, char *out, int max) |
| converts CQL sortby to sortkeys .. | |
CQL sortkeys utilities.
Definition in file cql_sortkeys.c.
|
static |
Definition at line 44 of file cql_sortkeys.c.
References cql_node::index, cql_node::modifiers, cql_node::st, and cql_node::u.
Referenced by cql_sortby_to_sortkeys().
| int cql_sortby_to_sortkeys | ( | struct cql_node * | cn, |
| void(*)(const char *buf, void *client_data) | pr, | ||
| void * | client_data | ||
| ) |
converts CQL sortby to sortkeys (ala versions 1.1)
| cn | CQL tree |
| pr | print function |
| client_data | data to be passed to pr function |
This will take CQL_NODE_SORT entries and conver them to
path,schema,ascending,caseSensitive,missingValue items..
One for each sort keys. Where
path is string index for sorting
schema is schema for sort index
ascending is a boolean (0=false, 1=true). Default is true.
caseSensitive is a boolean. Default is false.
missingValue is a string and one of 'abort', 'highValue', 'lowValue', or 'omit'. Default is 'highValue'.
See also http://www.loc.gov/standards/sru/sru-1-1.html#sort
Definition at line 83 of file cql_sortkeys.c.
References CQL_NODE_SORT, cql_sort_modifiers(), cql_node::index, cql_node::modifiers, cql_node::next, pr_n(), cql_node::sort, cql_node::u, and cql_node::which.
Referenced by cql_sortby_to_sortkeys_buf().
| int cql_sortby_to_sortkeys_buf | ( | struct cql_node * | cn, |
| char * | out, | ||
| int | max | ||
| ) |
converts CQL sortby to sortkeys ..
| cn | CQL tree |
| out | result buffer |
| max | size of buffer (allocated) |
| 0 | OK |
| -1 | ERROR |
Definition at line 120 of file cql_sortkeys.c.
References cql_buf_write_info::buf, cql_buf_write_handler(), cql_sortby_to_sortkeys(), cql_buf_write_info::max, and cql_buf_write_info::off.
Referenced by cql2pqf().
|
static |
Definition at line 20 of file cql_sortkeys.c.
Referenced by cql_sortby_to_sortkeys().