* 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.
*
*/
#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)