YAZ
5.34.0
|
Implements CQL tree node utilities. More...
Go to the source code of this file.
Functions | |
void | cql_fputs (const char *buf, void *client_data) |
stream handle for file (used by cql_to_xml_stdio) More... | |
struct cql_node * | cql_node_dup (NMEM nmem, struct cql_node *cp) |
struct cql_node * | cql_node_mk_sc (NMEM nmem, const char *index, const char *relation, const char *term) |
creates a search clause node (st). More... | |
struct cql_node * | cql_node_mk_boolean (NMEM nmem, const char *op) |
creates a boolean node. More... | |
struct cql_node * | cql_node_mk_sort (NMEM nmem, const char *index, struct cql_node *modifiers) |
creates a sort single spec node. More... | |
const char * | cql_uri (void) |
returns the standard CQL context set URI. More... | |
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 member index_uri / relation_uri is NULL. More... | |
void | cql_node_destroy (struct cql_node *cn) |
destroys a node and its children. More... | |
int | cql_strcmp (const char *s1, const char *s2) |
compares two CQL strings (ala strcmp) More... | |
int | cql_strncmp (const char *s1, const char *s2, size_t n) |
compares two CQL strings (ala strncmp) More... | |
Implements CQL tree node utilities.
Definition in file cqlutil.c.
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 member index_uri / relation_uri is NULL.
Definition at line 110 of file cqlutil.c.
References cql_node::boolean, CQL_NODE_BOOL, CQL_NODE_SORT, CQL_NODE_ST, cql_strncmp(), nmem_strdup(), cql_node::sort, cql_node::st, cql_node::u, and cql_node::which.
Referenced by cql_transform_r(), and yyparse().
void cql_fputs | ( | const char * | buf, |
void * | client_data | ||
) |
stream handle for file (used by cql_to_xml_stdio)
Definition at line 18 of file cqlutil.c.
Referenced by cql_to_ccl_stdio(), cql_to_xml_stdio(), and cql_transform_FILE().
void cql_node_destroy | ( | struct cql_node * | cn | ) |
destroys a node and its children.
Definition at line 173 of file cqlutil.c.
References cql_node::boolean, CQL_NODE_BOOL, CQL_NODE_SORT, CQL_NODE_ST, cql_node::sort, cql_node::st, cql_node::u, and cql_node::which.
Referenced by cql_parser_destroy(), cql_parser_stream(), and yyparse().
duplicates a node (returns a copy of supplied node) .
Definition at line 24 of file cqlutil.c.
References cql_node::boolean, CQL_NODE_BOOL, cql_node_mk_boolean(), cql_node_mk_sc(), cql_node_mk_sort(), CQL_NODE_SORT, CQL_NODE_ST, nmem_strdup(), cql_node::sort, cql_node::st, cql_node::u, and cql_node::which.
Referenced by yyparse().
creates a boolean node.
Definition at line 78 of file cqlutil.c.
References cql_node::boolean, CQL_NODE_BOOL, nmem_malloc(), nmem_strdup(), cql_node::u, and cql_node::which.
Referenced by cql_node_dup(), and yyparse().
struct cql_node* cql_node_mk_sc | ( | NMEM | nmem, |
const char * | index, | ||
const char * | relation, | ||
const char * | term | ||
) |
creates a search clause node (st).
Definition at line 55 of file cqlutil.c.
References CQL_NODE_ST, cql_node::index, nmem_malloc(), nmem_strdup(), cql_node::relation, cql_node::st, cql_node::term, cql_node::u, and cql_node::which.
Referenced by cql_node_dup(), and yyparse().
creates a sort single spec node.
Definition at line 91 of file cqlutil.c.
References CQL_NODE_SORT, cql_node::index, cql_node::modifiers, nmem_malloc(), nmem_strdup(), cql_node::sort, cql_node::u, and cql_node::which.
Referenced by cql_node_dup(), and yyparse().
int cql_strcmp | ( | const char * | s1, |
const char * | s2 | ||
) |
compares two CQL strings (ala strcmp)
s1 | string 1 |
s2 | string 2 |
Definition at line 194 of file cqlutil.c.
Referenced by bool(), cql_lookup_property(), cql_transform_r(), emit_node(), node(), and yylex().
int cql_strncmp | ( | const char * | s1, |
const char * | s2, | ||
size_t | n | ||
) |
compares two CQL strings (ala strncmp)
s1 | string 1 |
s2 | string 2 |
n | size |
Definition at line 210 of file cqlutil.c.
Referenced by cql_apply_prefix(), and cql_transform_r().
const char* cql_uri | ( | void | ) |
returns the standard CQL context set URI.
Definition at line 105 of file cqlutil.c.
Referenced by emit_node().