Run latex
[egate.git] / ccl / ccl.h
1 /* CCL - public header file
2  * Europagate, 1995
3  *
4  * $Log: ccl.h,v $
5  * Revision 1.4  1995/02/14 16:20:53  adam
6  * Qualifiers are read from a file now.
7  *
8  * Revision 1.3  1995/02/14  10:25:55  adam
9  * The constructions 'qualifier rel term ...' implemented.
10  *
11  * Revision 1.2  1995/02/13  15:15:06  adam
12  * Added handling of qualifiers. Not finished yet.
13  *
14  * Revision 1.1  1995/02/13  12:35:20  adam
15  * First version of CCL. Qualifiers aren't handled yet.
16  *
17  */
18
19 #define CCL_ERR_OK                0
20 #define CCL_ERR_TERM_EXPECTED     1
21 #define CCL_ERR_RP_EXPECTED       2
22 #define CCL_ERR_SETNAME_EXPECTED  3
23 #define CCL_ERR_OP_EXPECTED       4
24 #define CCL_ERR_BAD_RP            5
25 #define CCL_ERR_UNKNOWN_QUAL      6
26 #define CCL_ERR_DOBBLE_QUAL       7
27 #define CCL_ERR_EQ_EXPECTED       8
28 #define CCL_ERR_BAD_RELATION      9
29 #define CCL_ERR_TRUNC_NOT_LEFT   10
30 #define CCL_ERR_TRUNC_NOT_BOTH   11
31 #define CCL_ERR_TRUNC_NOT_RIGHT  12
32
33 struct ccl_rpn_attr {
34     struct ccl_rpn_attr *next;
35     int type;
36     int value;
37 };
38
39 struct ccl_rpn_node {
40     enum rpn_node_kind { AND, OR, NOT, TERM, SET, PROX } kind;
41     union {
42         struct ccl_rpn_node *p[2];
43         struct {
44             char *term;
45             struct ccl_rpn_attr *attr_list;
46         } t;
47         char *setname;
48     } u;
49 };
50
51 typedef struct ccl_qualifiers *CCL_bibset;
52
53
54 struct ccl_rpn_node *ccl_find_str (CCL_bibset bibset,
55                                    const char *str, int *error, int *pos);
56 char *ccl_err_msg (int ccl_errno);
57 void ccl_rpn_delete (struct ccl_rpn_node *rpn);
58 void ccl_pr_tree (struct ccl_rpn_node *rpn);
59
60 void ccl_qual_add (CCL_bibset b, const char *name, int no, int *attr);
61 void ccl_qual_file (CCL_bibset bibset, FILE *inf);
62 CCL_bibset ccl_qual_mk (void);
63 void ccl_qual_rm (CCL_bibset *b);
64 struct ccl_rpn_attr *ccl_qual_search (CCL_bibset b, const char *name, int len);
65
66
67
68 /* use (1)
69
70    relation (2)
71                             -1  none
72                              0  ordered
73                            1-6  relation (<, <=, =, >=, >, <>)
74
75    position (3)
76                             -1  none
77                              1  first in field
78                              2  first in sub field
79                              3  any position in field
80    structure (4)
81                             -1  none
82                              0  word/phrase auto select
83                              1  phrase
84                              2  word
85                              3  key
86                              4  year
87                              5  date (normalized)
88                              6  word list 
89                            100  date (un-normalized)
90                            101  name (normalized)
91                            102  name (un-normalized)
92    truncation (5)                            
93    completeness (6)
94 */
95
96 #define CCL_BIB1_USE 1
97 #define CCL_BIB1_REL 2
98 #define CCL_BIB1_POS 3
99 #define CCL_BIB1_STR 4
100 #define CCL_BIB1_TRU 5
101 #define CCL_BIB1_COM 6
102
103 #define CCL_BIB1_STR_WP (-1)
104 #define CCL_BIB1_REL_ORDER (-1)
105
106 #define CCL_BIB1_TRU_CAN_LEFT (-1)
107 #define CCL_BIB1_TRU_CAN_RIGHT (-2)
108 #define CCL_BIB1_TRU_CAN_BOTH  (-3)
109 #define CCL_BIB1_TRU_CAN_NONE  (-4)