X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fyaz%2Fcql.h;h=41c831592cc11db0daee2ef5344bd8f0eab84dba;hb=725fc033b729b22a1e0cfba614192b6fbfaeda4f;hp=4b75df2ce8376ff3657ec272eba74d4e5d862ed2;hpb=f512aa33473ae86f8e8efd8da749a82c398e87f0;p=yaz-moved-to-github.git diff --git a/include/yaz/cql.h b/include/yaz/cql.h index 4b75df2..41c8315 100644 --- a/include/yaz/cql.h +++ b/include/yaz/cql.h @@ -1,5 +1,5 @@ -/* $Id: cql.h,v 1.3 2003-02-18 21:27:53 adam Exp $ - Copyright (C) 2002-2003 +/* $Id: cql.h,v 1.7 2004-03-15 21:39:06 adam Exp $ + Copyright (C) 2002-2004 Index Data Aps This file is part of the YAZ toolkit. @@ -12,6 +12,8 @@ See the file LICENSE. #include #include +YAZ_BEGIN_CDECL + typedef struct cql_parser *CQL_parser; /** @@ -86,23 +88,18 @@ struct cql_node { union { struct { char *index; + char *index_uri; char *term; char *relation; + char *relation_uri; struct cql_node *modifiers; - struct cql_node *prefixes; } st; struct { char *value; struct cql_node *left; struct cql_node *right; struct cql_node *modifiers; - struct cql_node *prefixes; } boolean; - struct { - char *name; - char *value; - struct cql_node *next; - } mod; } u; }; @@ -123,19 +120,17 @@ YAZ_EXPORT struct cql_node *cql_node_mk_sc(const char *index, const char *relation, const char *term); + + +YAZ_EXPORT +struct cql_node *cql_apply_prefix(struct cql_node *cn, + const char *relation, + const char *term); YAZ_EXPORT struct cql_node *cql_node_mk_boolean(const char *op); YAZ_EXPORT void cql_node_destroy(struct cql_node *cn); YAZ_EXPORT -struct cql_node *cql_node_prefix(struct cql_node *n, - const char *prefix, - const char *uri); -YAZ_EXPORT -struct cql_node *cql_node_mk_mod(const char *name, - const char *value); - -YAZ_EXPORT struct cql_node *cql_node_dup (struct cql_node *cp); YAZ_EXPORT struct cql_node *cql_parser_result(CQL_parser cp); @@ -184,44 +179,13 @@ int cql_transform_buf(cql_transform_t ct, YAZ_EXPORT int cql_transform_error(cql_transform_t ct, const char **addinfo); -/* -10 Illegal query -11 Unsupported query type (XCQL vs CQL) -12 Too many characters in query -13 Unbalanced or illegal use of parentheses -14 Unbalanced or illegal use of quotes -15 Illegal or unsupported index set -16 Illegal or unsupported index -17 Illegal or unsupported combination of index and index set -18 Illegal or unsupported combination of indexes -19 Illegal or unsupported relation -20 Illegal or unsupported relation modifier -21 Illegal or unsupported combination of relation modifers -22 Illegal or unsupported combination of relation and index -23 Too many characters in term -24 Illegal combination of relation and term -25 Special characters not quoted in term -26 Non special character escaped in term -27 Empty term unsupported -28 Masking character not supported -29 Masked words too short -30 Too many masking characters in term -31 Anchoring character not supported -32 Anchoring character in illegal or unsupported position -33 Combination of proximity/adjacency and masking characters not supported -34 Combination of proximity/adjacency and anchoring characters not supported -35 Terms only exclusion (stop) words -36 Term in invalid format for index or relation -37 Illegal or unsupported boolean operator -38 Too many boolean operators in query -39 Proximity not supported -40 Illegal or unsupported proximity relation -41 Illegal or unsupported proximity distance -42 Illegal or unsupported proximity unit -43 Illegal or unsupported proximity ordering -44 Illegal or unsupported combination of proximity modifiers -45 Index set name (prefix) assigned to multiple identifiers -*/ +YAZ_EXPORT +const char *cql_strerror(int code); + +YAZ_EXPORT +const char *cql_uri(); + +YAZ_END_CDECL #endif /* CQL_H_INCLUDED */