*/
/** \file ccl.h
- \brief Header with public definitions about CCL.
+ \brief Header with public definitions for CCL.
*/
/*
* CCL - header file
*
- * $Id: ccl.h,v 1.19 2004-10-03 22:34:07 adam Exp $
+ * $Id: ccl.h,v 1.23 2005-06-25 15:46:01 adam Exp $
*
* Old Europagate Log:
*
#define CCL_RPN_ATTR_NUMERIC 1
#define CCL_RPN_ATTR_STRING 2
union {
- /** numeric attribute value */
- int numeric;
- /** string attribute value */
- char *str;
+ /** numeric attribute value */
+ int numeric;
+ /** string attribute value */
+ char *str;
} value;
};
/** RPN tree node type */
int kind;
union {
- /** Boolean including proximity 0=left, 2=right, 3=prox parms */
- struct ccl_rpn_node *p[3];
- /** Attributes + Term */
- struct {
- char *term;
- struct ccl_rpn_attr *attr_list;
- } t;
- /** Result set */
- char *setname;
+ /** Boolean including proximity 0=left, 2=right, 3=prox parms */
+ struct ccl_rpn_node *p[3];
+ /** Attributes + Term */
+ struct {
+ char *term;
+ struct ccl_rpn_attr *attr_list;
+ } t;
+ /** Result set */
+ char *setname;
} u;
};
/** CCL token */
struct ccl_token {
char kind;
- size_t len;
- const char *name;
+ size_t len; /* length of name below */
+ const char *name; /* string / name of token */
struct ccl_token *next;
struct ccl_token *prev;
+ const char *ws_prefix_buf; /* leading white space buf */
+ size_t ws_prefix_len; /* leading white space len */
};
/** CCL Qualifier */
YAZ_EXPORT
struct ccl_token *ccl_tokenize (const char *command);
-/**
- * Splits CCL command into tokens. This function is obsolete. Use
- * ccl_parser_tokenize instead.
- */
-YAZ_EXPORT
-struct ccl_token *ccl_token_simple (const char *command);
-
/**
* Deletes token list
*/
*/
YAZ_EXPORT
struct ccl_rpn_node *ccl_find_str (CCL_bibset bibset,
- const char *str, int *error, int *pos);
+ const char *str, int *error, int *pos);
/**
* Parses CCL Find command from a list of CCL tokens. Otherwise similar to
/** Add qualifier and supply attributes pairs+attribute set for it */
YAZ_EXPORT
void ccl_qual_add_set (CCL_bibset b, const char *name, int no,
- int *type, int *value, char **svalue, char **attsets);
+ int *type, int *value, char **svalue, char **attsets);
/** Add special qualifier */
YAZ_EXPORT
/* Add CCL qualifier by using qual_name + value pair */
YAZ_EXPORT
void ccl_qual_fitem (CCL_bibset bibset, const char *value,
- const char *qual_name);
+ const char *qual_name);
/** Make CCL qualifier set */
YAZ_EXPORT
/** 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);
+ size_t len, int seq);
/** Create CCL parser */
YAZ_EXPORT
/** Search for special qualifier */
YAZ_EXPORT
const char *ccl_qual_search_special (CCL_bibset b,
- const char *name);
+ const char *name);
/** Pretty-print CCL RPN node tree to WRBUF */
YAZ_EXPORT
void ccl_pquery (WRBUF w, struct ccl_rpn_node *p);
#endif
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+