X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=ccl%2Fccl.h;h=da94d92d43ed79630d4a14b252b6ddfe02f096df;hb=373495ef158d123d95ab44465d4249e65847492b;hp=444575e671b7acd616a72a9dfd5c92b7184ec25d;hpb=68727e97f4ab17a7008c5a8552796ec123af031c;p=egate.git diff --git a/ccl/ccl.h b/ccl/ccl.h index 444575e..da94d92 100644 --- a/ccl/ccl.h +++ b/ccl/ccl.h @@ -2,7 +2,16 @@ * Europagate, 1995 * * $Log: ccl.h,v $ - * Revision 1.1 1995/02/13 12:35:20 adam + * Revision 1.4 1995/02/14 16:20:53 adam + * Qualifiers are read from a file now. + * + * Revision 1.3 1995/02/14 10:25:55 adam + * The constructions 'qualifier rel term ...' implemented. + * + * Revision 1.2 1995/02/13 15:15:06 adam + * Added handling of qualifiers. Not finished yet. + * + * Revision 1.1 1995/02/13 12:35:20 adam * First version of CCL. Qualifiers aren't handled yet. * */ @@ -13,7 +22,88 @@ #define CCL_ERR_SETNAME_EXPECTED 3 #define CCL_ERR_OP_EXPECTED 4 #define CCL_ERR_BAD_RP 5 +#define CCL_ERR_UNKNOWN_QUAL 6 +#define CCL_ERR_DOBBLE_QUAL 7 +#define CCL_ERR_EQ_EXPECTED 8 +#define CCL_ERR_BAD_RELATION 9 +#define CCL_ERR_TRUNC_NOT_LEFT 10 +#define CCL_ERR_TRUNC_NOT_BOTH 11 +#define CCL_ERR_TRUNC_NOT_RIGHT 12 + +struct ccl_rpn_attr { + struct ccl_rpn_attr *next; + int type; + int value; +}; -void ccl_find_str (const char *str, int *error, int *pos); +struct ccl_rpn_node { + enum rpn_node_kind { AND, OR, NOT, TERM, SET, PROX } kind; + union { + struct ccl_rpn_node *p[2]; + struct { + char *term; + struct ccl_rpn_attr *attr_list; + } t; + char *setname; + } u; +}; +typedef struct ccl_qualifiers *CCL_bibset; + + +struct ccl_rpn_node *ccl_find_str (CCL_bibset bibset, + const char *str, int *error, int *pos); char *ccl_err_msg (int ccl_errno); +void ccl_rpn_delete (struct ccl_rpn_node *rpn); +void ccl_pr_tree (struct ccl_rpn_node *rpn); + +void ccl_qual_add (CCL_bibset b, const char *name, int no, int *attr); +void ccl_qual_file (CCL_bibset bibset, FILE *inf); +CCL_bibset ccl_qual_mk (void); +void ccl_qual_rm (CCL_bibset *b); +struct ccl_rpn_attr *ccl_qual_search (CCL_bibset b, const char *name, int len); + + + +/* use (1) + + relation (2) + -1 none + 0 ordered + 1-6 relation (<, <=, =, >=, >, <>) + + position (3) + -1 none + 1 first in field + 2 first in sub field + 3 any position in field + structure (4) + -1 none + 0 word/phrase auto select + 1 phrase + 2 word + 3 key + 4 year + 5 date (normalized) + 6 word list + 100 date (un-normalized) + 101 name (normalized) + 102 name (un-normalized) + truncation (5) + completeness (6) +*/ + +#define CCL_BIB1_USE 1 +#define CCL_BIB1_REL 2 +#define CCL_BIB1_POS 3 +#define CCL_BIB1_STR 4 +#define CCL_BIB1_TRU 5 +#define CCL_BIB1_COM 6 + +#define CCL_BIB1_STR_WP (-1) +#define CCL_BIB1_REL_ORDER (-1) + +#define CCL_BIB1_TRU_CAN_LEFT (-1) +#define CCL_BIB1_TRU_CAN_RIGHT (-2) +#define CCL_BIB1_TRU_CAN_BOTH (-3) +#define CCL_BIB1_TRU_CAN_NONE (-4)