Work on delete of objects.
[ir-tcl-moved-to-github.git] / ir-tclp.h
1 /*
2  * IR toolkit for tcl/tk
3  * (c) Index Data 1995
4  * See the file LICENSE for details.
5  * Sebastian Hammer, Adam Dickmeiss
6  *
7  * $Log: ir-tclp.h,v $
8  * Revision 1.5  1995-05-29 08:44:25  adam
9  * Work on delete of objects.
10  *
11  * Revision 1.4  1995/05/26  11:44:10  adam
12  * Bugs fixed. More work on MARC utilities and queries. Test
13  * client is up-to-date again.
14  *
15  * Revision 1.3  1995/05/26  08:54:17  adam
16  * New MARC utilities. Uses prefix query.
17  *
18  * Revision 1.2  1995/05/24  14:10:23  adam
19  * Work on idAuthentication, protocolVersion and options.
20  *
21  * Revision 1.1  1995/05/23  15:34:49  adam
22  * Many new settings, userInformationField, smallSetUpperBound, etc.
23  * A number of settings are inherited when ir-set is executed.
24  * This version is incompatible with the graphical test client (client.tcl).
25  *
26  */
27
28 #ifndef IR_TCLP_H
29 #define IR_TCLP_H
30
31 #include <tcl.h>
32
33 #include <log.h>
34 #include <pquery.h>
35 #if CCL2RPN
36 #include <yaz-ccl.h>
37 #endif
38 #if 0
39 #include <iso2709.h>
40 #endif
41
42 #include <comstack.h>
43 #include <tcpip.h>
44
45 #if MOSI
46 #include <xmosi.h>
47 #endif
48
49 #include <odr.h>
50 #include <proto.h>
51 #include <oid.h>
52 #include <diagbib1.h>
53
54 #include "ir-tcl.h"
55
56 typedef struct {
57     char      **databaseNames;
58     int         num_databaseNames;
59
60     char       *queryType;
61     int         replaceIndicator;
62
63     int         smallSetUpperBound;
64     int         largeSetLowerBound;
65     int         mediumSetPresentNumber;
66 } IRSetCObj;
67     
68 typedef struct {
69     int         ref_count;
70
71     char       *cs_type;
72     char       *protocol_type;
73     int         connectFlag;
74     COMSTACK    cs_link;
75
76     int         preferredMessageSize;
77     int         maximumRecordSize;
78     Odr_bitmask options;
79     Odr_bitmask protocolVersion;
80
81     char       *idAuthenticationOpen;
82     char       *idAuthenticationGroupId;
83     char       *idAuthenticationUserId;
84     char       *idAuthenticationPassword;
85
86     char       *implementationName;
87     char       *implementationId;
88     int        initResult;
89     char       *targetImplementationName;
90     char       *targetImplementationId;
91     char       *targetImplementationVersion;
92     char       *userInformationField;
93
94     char       *hostname;
95    
96     char       *buf_out;
97     int         len_out;
98     char       *buf_in;
99     int         len_in;
100     char       *sbuf;
101     int         slen;
102     ODR         odr_in;
103     ODR         odr_out;
104     ODR         odr_pr;
105
106     Tcl_Interp *interp;
107     char       *callback;
108     char       *failback;
109
110 #if CCL2RPN
111     CCL_bibset  bibset;
112 #endif
113
114     struct IRSetObj_ *set_child;
115     struct IRScanObj_ *scan_child;
116
117     IRSetCObj   set_inher;
118 } IRObj;
119
120 typedef struct IRRecordList_ {
121     int no;
122     int which;
123     union {
124         struct {
125             char *buf;
126             size_t size;
127         } dbrec;
128         struct {
129             int  condition;
130             char *addinfo;
131         } diag;
132     } u;
133     struct IRRecordList_ *next;
134 } IRRecordList;
135
136 typedef struct IRSetObj_ {
137     IRObj      *parent;
138     int         searchStatus;
139     int         presentStatus;
140     int         resultCount;
141     int         nextResultSetPosition;
142     int         start;
143     int         number;
144     int         numberOfRecordsReturned;
145     char       *setName;
146     int         recordFlag;
147     int         which;
148     int         condition;
149     char       *addinfo;
150     IRRecordList *record_list;
151     IRSetCObj   set_inher;
152 } IRSetObj;
153
154 typedef struct IRScanEntry_ {
155     int         which;
156     union {
157         struct {
158             char *buf;
159             int  globalOccurrences;
160         } term;
161         struct {
162             int  condition;
163             char *addinfo;
164         } diag;
165     } u;
166 } IRScanEntry;
167
168 typedef struct IRScanDiag_ {
169     int         dummy;
170 } IRScanDiag;
171
172 typedef struct IRScanObj_ {
173     IRObj      *parent;
174     int         stepSize;
175     int         numberOfTermsRequested;
176     int         preferredPositionInResponse;
177
178     int         scanStatus;
179     int         numberOfEntriesReturned;
180     int         positionOfTerm;
181
182     int         entries_flag;
183     int         which;
184
185     int         num_entries;
186     int         num_diagRecs;
187
188     IRScanEntry *entries;
189     IRScanDiag  *nonSurrogateDiagnostics;
190 } IRScanObj;
191
192 struct ir_named_entry {
193     char *name;
194     int  pos;
195 };
196
197 int ir_tcl_get_marc (Tcl_Interp *interp, const char *buf,
198                      int argc, char **argv);
199 char *ir_tcl_fread_marc (FILE *inf, size_t *size);
200 #endif