X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fyaz%2Fccl.h;h=e6c5af2bd5b275a7a0404834731bf2b608ee4264;hb=bab540a6816b1ae07a834075e0c71d0f160565e4;hp=78e90c397fbfbaf6362cae8cb434cca16035630d;hpb=5465ce3572dee9b6dcbea43ebf02d9d548b6644d;p=yaz-moved-to-github.git diff --git a/include/yaz/ccl.h b/include/yaz/ccl.h index 78e90c3..e6c5af2 100644 --- a/include/yaz/ccl.h +++ b/include/yaz/ccl.h @@ -49,7 +49,7 @@ /* * CCL - header file * - * $Id: ccl.h,v 1.25 2007-04-26 09:11:56 adam Exp $ + * $Id: ccl.h,v 1.29 2007-05-01 12:22:10 adam Exp $ * * Old Europagate Log: * @@ -150,6 +150,7 @@ struct ccl_rpn_node { /** \brief Attributes + Term */ struct { char *term; + char *qual; struct ccl_rpn_attr *attr_list; } t; /** Result set */ @@ -185,22 +186,6 @@ struct ccl_rpn_node *ccl_find_str(CCL_bibset bibset, YAZ_EXPORT struct ccl_rpn_node *ccl_parser_find_str(CCL_parser cclp, const char *str); -/** Set names for AND operator in parser */ -YAZ_EXPORT -void ccl_parser_set_op_and(CCL_parser p, const char *op); - -/** Set names for OR operator in parser */ -YAZ_EXPORT -void ccl_parser_set_op_or(CCL_parser p, const char *op); - -/** Set names for ANDNOT operator in parser */ -YAZ_EXPORT -void ccl_parser_set_op_not(CCL_parser p, const char *op); - -/** Set names for ResultSet in parser */ -YAZ_EXPORT -void ccl_parser_set_op_set(CCL_parser p, const char *op); - /** Set case sensitivity for parser */ YAZ_EXPORT void ccl_parser_set_case(CCL_parser p, int case_sensitivity_flag); @@ -228,11 +213,11 @@ void ccl_qual_add_set(CCL_bibset b, const char *name, int no, /** Add special qualifier */ YAZ_EXPORT -void ccl_qual_add_special(CCL_bibset bibset, const char *n, const char *v); +void ccl_qual_add_special(CCL_bibset bibset, const char *n, const char *cp); /** Add combo qualifier */ YAZ_EXPORT -void ccl_qual_add_combi(CCL_bibset b, const char *n, const char *names); +void ccl_qual_add_combi(CCL_bibset b, const char *n, const char **names); /** Read CCL qualifier list spec from file inf */ YAZ_EXPORT @@ -274,11 +259,6 @@ int ccl_stricmp(const char *s1, const char *s2); YAZ_EXPORT int ccl_memicmp(const char *s1, const char *s2, size_t n); -/** Search for qualifier 'name' in set 'b'. */ -YAZ_EXPORT -struct ccl_rpn_attr *ccl_qual_search(CCL_parser cclp, const char *name, - size_t len, int seq); - /** Create CCL parser */ YAZ_EXPORT CCL_parser ccl_parser_create(CCL_bibset bibset); @@ -289,7 +269,7 @@ void ccl_parser_destroy(CCL_parser p); /** Search for special qualifier */ YAZ_EXPORT -const char *ccl_qual_search_special(CCL_bibset b, const char *name); +const char **ccl_qual_search_special(CCL_bibset b, const char *name); /** Pretty-print CCL RPN node tree to WRBUF */ YAZ_EXPORT void ccl_pquery(WRBUF w, struct ccl_rpn_node *p); @@ -297,6 +277,43 @@ void ccl_pquery(WRBUF w, struct ccl_rpn_node *p); YAZ_EXPORT int ccl_parser_get_error(CCL_parser cclp, int *pos); +YAZ_EXPORT +struct ccl_rpn_node *ccl_rpn_node_create(enum ccl_rpn_kind kind); + +YAZ_EXPORT +void ccl_add_attr_numeric(struct ccl_rpn_node *p, const char *set, + int type, int value); + +YAZ_EXPORT +void ccl_add_attr_string(struct ccl_rpn_node *p, const char *set, + int type, char *value); + +YAZ_EXPORT +int ccl_search_stop(CCL_bibset bibset, const char *qname, + const char *src_str, size_t src_len); + + +/** \brief stop words handle (pimpl) */ +typedef struct ccl_stop_words *ccl_stop_words_t; + +/** \brief creates stop words handle */ +YAZ_EXPORT +ccl_stop_words_t ccl_stop_words_create(void); + +/** \brief destroys stop words handle */ +YAZ_EXPORT +void ccl_stop_words_destroy(ccl_stop_words_t csw); + +/** \brief removes stop words from RPN tree */ +YAZ_EXPORT +int ccl_stop_words_tree(ccl_stop_words_t csw, + CCL_bibset bibset, struct ccl_rpn_node **t); + +/** \brief returns information about removed "stop" words */ +YAZ_EXPORT +int ccl_stop_words_info(ccl_stop_words_t csw, int idx, + const char **qualname, const char **term); + #ifndef ccl_assert #define ccl_assert(x) ; #endif