X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fccl.h;h=a23b3949652f614d93515ba6075dddf954ad6cf6;hb=4938d0c2e8f4e1eec397c2bfbbc7e23fd150c369;hp=49df395445178e790485e137ecc8d656e2785aa4;hpb=e1ec9d39463f431383547891f38e30f2ff17842c;p=egate.git diff --git a/include/ccl.h b/include/ccl.h index 49df395..a23b394 100644 --- a/include/ccl.h +++ b/include/ccl.h @@ -46,7 +46,17 @@ * CCL - header file * * $Log: ccl.h,v $ - * Revision 1.7 1995/05/16 09:39:38 adam + * Revision 1.10 1996/01/08 08:41:22 adam + * Minor changes. + * + * Revision 1.9 1995/07/20 08:15:16 adam + * Bug fix: Token value for comma and OR were the same! + * + * Revision 1.8 1995/07/11 12:28:34 adam + * New function: ccl_token_simple (split into simple tokens) and + * ccl_token_del (delete tokens). + * + * Revision 1.7 1995/05/16 09:39:38 adam * LICENSE. * * Revision 1.6 1995/05/11 14:04:03 adam @@ -166,11 +176,12 @@ typedef struct ccl_qualifiers *CCL_bibset; #define CCL_TOK_RP 6 #define CCL_TOK_COMMA 7 #define CCL_TOK_AND 8 -#define CCL_TOK_OR 7 -#define CCL_TOK_NOT 9 -#define CCL_TOK_MINUS 10 -#define CCL_TOK_SET 11 +#define CCL_TOK_OR 9 +#define CCL_TOK_NOT 10 +#define CCL_TOK_MINUS 11 +#define CCL_TOK_SET 12 +/* CCL token */ struct ccl_token { char kind; char len; @@ -179,39 +190,72 @@ struct ccl_token { struct ccl_token *prev; }; +/* CCL Qualifier */ struct ccl_qualifier { char *name; struct ccl_rpn_attr *attr_list; struct ccl_qualifier *next; }; +/* Generate tokens from command string - obeys all CCL opererators */ struct ccl_token *ccl_tokenize (const char *command); +/* Generate tokens from command string - oebeys only simple tokens and + quoted strings */ +struct ccl_token *ccl_token_simple (const char *command); + +/* Delete token list */ +void ccl_token_del (struct ccl_token *list); + +/* Parse CCL Find command - NULL-terminated string */ struct ccl_rpn_node *ccl_find_str (CCL_bibset bibset, const char *str, int *error, int *pos); +/* Parse CCL Find command - Tokens read by ccl_tokenize */ struct ccl_rpn_node *ccl_find (CCL_bibset abibset, struct ccl_token *list, int *error, const char **pos); + +/* Return english-readable error message */ char *ccl_err_msg (int ccl_errno); + +/* Delete RPN tree returned by ccl_find */ void ccl_rpn_delete (struct ccl_rpn_node *rpn); + +/* Dump RPN tree in readable format to fd_out */ void ccl_pr_tree (struct ccl_rpn_node *rpn, FILE *fd_out); +/* Add CCL qualifier */ void ccl_qual_add (CCL_bibset b, const char *name, int no, int *attr); + +/* Read CCL qualifier list spec from file inf */ void ccl_qual_file (CCL_bibset bibset, FILE *inf); + +/* Add CCL qualifier by using single-line spec */ void ccl_qual_fitem (CCL_bibset bibset, const char *cp, const char *qual_name); + +/* Make CCL qualifier set */ CCL_bibset ccl_qual_mk (void); + +/* Delete CCL qualifier set */ void ccl_qual_rm (CCL_bibset *b); +/* Misc. reserved words */ extern const char *ccl_token_and; extern const char *ccl_token_or; extern const char *ccl_token_not; extern const char *ccl_token_set; + +/* Whether the CCL parser is command sensitive */ extern int ccl_case_sensitive; + +/* Char-to-upper function */ extern int (*ccl_toupper)(int c); +/* String utilities */ int ccl_stricmp (const char *s1, const char *s2); int ccl_memicmp (const char *s1, const char *s2, size_t n); +/* Search for qualifier 'name' in set 'b'. */ struct ccl_rpn_attr *ccl_qual_search (CCL_bibset b, const char *name, int len); #endif