20 FILE *f = (FILE *) client_data;
37 cn->
u.
st.index_uri = cp->
u.
st.index_uri ?
39 cn->
u.
st.relation_uri = cp->
u.
st.relation_uri ?
65 p->
u.
st.index_uri = 0;
72 p->
u.
st.relation_uri = 0;
73 p->
u.
st.modifiers = 0;
74 p->
u.
st.extra_terms = 0;
101 p->
u.
sort.search = 0;
107 return "info:srw/cql-context-set/1/cql-v1.2";
111 struct cql_node *n,
const char *prefix,
116 if (!n->
u.
st.index_uri && n->
u.
st.index)
118 const char *cp = strchr(n->
u.
st.index,
'.');
120 strlen(prefix) == (
size_t) (cp - n->
u.
st.index) &&
125 n->
u.
st.index = nval;
127 else if (!prefix && !cp)
132 if (!n->
u.
st.relation_uri && n->
u.
st.relation)
134 const char *cp = strchr(n->
u.
st.relation,
'.');
136 strlen(prefix) == (
size_t)(cp - n->
u.
st.relation) &&
141 n->
u.
st.relation = nval;
145 for (mod = n->
u.
st.modifiers; mod; mod = mod->
u.
st.modifiers)
147 if (!mod->
u.
st.index_uri && mod->
u.
st.index)
149 const char *cp = strchr(mod->
u.
st.index,
'.');
151 strlen(prefix) == (
size_t) (cp - mod->
u.
st.index) &&
156 mod->
u.
st.index = nval;
200 if (c1 >=
'A' && c1 <=
'Z')
201 c1 = c1 + (
'a' -
'A');
202 if (c2 >=
'A' && c2 <=
'Z')
203 c2 = c2 + (
'a' -
'A');
212 while (*s1 && *s2 && n)
216 if (c1 >=
'A' && c1 <=
'Z')
217 c1 = c1 + (
'a' -
'A');
218 if (c2 >=
'A' && c2 <=
'Z')
219 c2 = c2 + (
'a' -
'A');
Header with public definitions about CQL.
#define CQL_NODE_SORT
Node type: sortby single spec.
#define CQL_NODE_ST
Node type: search term.
#define CQL_NODE_BOOL
Node type: boolean.
int cql_strcmp(const char *s1, const char *s2)
compares two CQL strings (ala strcmp)
int cql_strncmp(const char *s1, const char *s2, size_t n)
compares two CQL strings (ala strncmp)
struct cql_node * cql_node_mk_sort(NMEM nmem, const char *index, struct cql_node *modifiers)
creates a sort single spec node.
struct cql_node * cql_node_mk_sc(NMEM nmem, const char *index, const char *relation, const char *term)
creates a search clause node (st).
struct cql_node * cql_node_dup(NMEM nmem, struct cql_node *cp)
void cql_fputs(const char *buf, void *client_data)
stream handle for file (used by cql_to_xml_stdio)
void cql_node_destroy(struct cql_node *cn)
destroys a node and its children.
struct cql_node * cql_apply_prefix(NMEM nmem, struct cql_node *n, const char *prefix, const char *uri)
applies a prefix+uri to "unresolved" index and relation URIs. "unresolved" URIs are those nodes where...
struct cql_node * cql_node_mk_boolean(NMEM nmem, const char *op)
creates a boolean node.
const char * cql_uri(void)
returns the standard CQL context set URI.
void * nmem_malloc(NMEM n, size_t size)
allocates memory block on NMEM handle
char * nmem_strdup(NMEM mem, const char *src)
allocates string on NMEM handle (similar strdup)
struct cql_node::@10::@12 boolean
struct cql_node::@10::@13 sort
struct cql_node::@10::@11 st
struct cql_node * modifiers