5 * Revision 1.2 1995-09-27 15:02:46 quinn
6 * Modified function heads & prototypes.
8 * Revision 1.1 1995/04/10 10:28:27 quinn
11 * Revision 1.5 1995/02/23 08:32:11 adam
14 * Revision 1.3 1995/02/16 13:20:10 adam
17 * Revision 1.2 1995/02/15 17:43:08 adam
18 * Minor changes to the ccl interface. Bug fix in iso2709 module.
20 * Revision 1.1 1995/02/14 19:55:21 adam
21 * Header files ccl.h/cclp.h are gone! They have been merged an
22 * moved to ../include/ccl.h.
31 /* CCL error numbers */
33 #define CCL_ERR_TERM_EXPECTED 1
34 #define CCL_ERR_RP_EXPECTED 2
35 #define CCL_ERR_SETNAME_EXPECTED 3
36 #define CCL_ERR_OP_EXPECTED 4
37 #define CCL_ERR_BAD_RP 5
38 #define CCL_ERR_UNKNOWN_QUAL 6
39 #define CCL_ERR_DOUBLE_QUAL 7
40 #define CCL_ERR_EQ_EXPECTED 8
41 #define CCL_ERR_BAD_RELATION 9
42 #define CCL_ERR_TRUNC_NOT_LEFT 10
43 #define CCL_ERR_TRUNC_NOT_BOTH 11
44 #define CCL_ERR_TRUNC_NOT_RIGHT 12
46 /* attribute pair (type, value) */
48 struct ccl_rpn_attr *next;
53 /* RPN tree structure */
56 CCL_RPN_AND, CCL_RPN_OR, CCL_RPN_NOT,
62 struct ccl_rpn_node *p[2];
65 struct ccl_rpn_attr *attr_list;
71 typedef struct ccl_qualifiers *CCL_bibset;
78 1-6 relation (<, <=, =, >=, >, <>)
84 3 any position in field
87 0 word/phrase auto select
94 100 date (un-normalized)
96 102 name (un-normalized)
101 #define CCL_BIB1_USE 1
102 #define CCL_BIB1_REL 2
103 #define CCL_BIB1_POS 3
104 #define CCL_BIB1_STR 4
105 #define CCL_BIB1_TRU 5
106 #define CCL_BIB1_COM 6
108 #define CCL_BIB1_STR_WP (-1)
109 #define CCL_BIB1_REL_ORDER (-1)
111 #define CCL_BIB1_TRU_CAN_LEFT (-1)
112 #define CCL_BIB1_TRU_CAN_RIGHT (-2)
113 #define CCL_BIB1_TRU_CAN_BOTH (-3)
114 #define CCL_BIB1_TRU_CAN_NONE (-4)
116 #define CCL_TOK_EOL 0
117 #define CCL_TOK_TERM 1
118 #define CCL_TOK_REL 2
120 #define CCL_TOK_PROX 4
123 #define CCL_TOK_COMMA 7
124 #define CCL_TOK_AND 8
126 #define CCL_TOK_NOT 9
127 #define CCL_TOK_MINUS 10
128 #define CCL_TOK_SET 11
134 struct ccl_token *next;
135 struct ccl_token *prev;
138 struct ccl_qualifier {
140 struct ccl_rpn_attr *attr_list;
141 struct ccl_qualifier *next;
144 struct ccl_token MDF *ccl_tokenize (const char *command);
146 struct ccl_rpn_node MDF *ccl_find_str (CCL_bibset bibset,
147 const char *str, int *error, int *pos);
149 struct ccl_rpn_node MDF *ccl_find (CCL_bibset abibset, struct ccl_token *list,
150 int *error, const char **pos);
151 char MDF *ccl_err_msg (int ccl_errno);
152 void MDF ccl_rpn_delete (struct ccl_rpn_node *rpn);
153 void MDF ccl_pr_tree (struct ccl_rpn_node *rpn, FILE *fd_out);
155 void MDF ccl_qual_add (CCL_bibset b, const char *name, int no, int *attr);
156 void MDF ccl_qual_file (CCL_bibset bibset, FILE *inf);
157 CCL_bibset MDF ccl_qual_mk (void);
158 void MDF ccl_qual_rm (CCL_bibset *b);
160 extern const char *ccl_token_and;
161 extern const char *ccl_token_or;
162 extern const char *ccl_token_not;
163 extern const char *ccl_token_set;
166 struct ccl_rpn_attr MDF *ccl_qual_search (CCL_bibset b, const char *name, int len);