2 * IR toolkit for tcl/tk
4 * See the file LICENSE for details.
5 * Sebastian Hammer, Adam Dickmeiss
8 * Revision 1.16 1995-09-20 11:37:01 adam
9 * Configure searches for tk4.1 and tk7.5.
12 * Revision 1.15 1995/08/29 15:30:15 adam
13 * Work on GRS records.
15 * Revision 1.14 1995/08/04 11:32:40 adam
16 * More work on output queue. Memory related routines moved
19 * Revision 1.13 1995/08/03 13:23:00 adam
22 * Revision 1.12 1995/07/28 10:28:38 adam
23 * First work on request queue.
25 * Revision 1.11 1995/06/20 08:07:35 adam
26 * New setting: failInfo.
27 * Working on better cancel mechanism.
29 * Revision 1.10 1995/06/16 12:28:20 adam
30 * Implemented preferredRecordSyntax.
31 * Minor changes in diagnostic handling.
32 * Record list deleted when connection closes.
34 * Revision 1.9 1995/06/14 15:08:01 adam
35 * Bug fix in cascade-target-list. Uses yaz-version.h.
37 * Revision 1.8 1995/06/14 13:37:18 adam
38 * Setting recordType implemented.
39 * Setting implementationVersion implemented.
40 * Settings implementationId / implementationName edited.
42 * Revision 1.7 1995/06/01 07:31:28 adam
43 * Rename of many typedefs -> IrTcl_...
45 * Revision 1.6 1995/05/31 08:36:40 adam
46 * Bug fix in client.tcl: didn't save options on clientrc.tcl.
47 * New method: referenceId. More work on scan.
49 * Revision 1.5 1995/05/29 08:44:25 adam
50 * Work on delete of objects.
52 * Revision 1.4 1995/05/26 11:44:10 adam
53 * Bugs fixed. More work on MARC utilities and queries. Test
54 * client is up-to-date again.
56 * Revision 1.3 1995/05/26 08:54:17 adam
57 * New MARC utilities. Uses prefix query.
59 * Revision 1.2 1995/05/24 14:10:23 adam
60 * Work on idAuthentication, protocolVersion and options.
62 * Revision 1.1 1995/05/23 15:34:49 adam
63 * Many new settings, userInformationField, smallSetUpperBound, etc.
64 * A number of settings are inherited when ir-set is executed.
65 * This version is incompatible with the graphical test client (client.tcl).
87 #include <yaz-version.h>
97 int num_databaseNames;
99 enum oid_value *preferredRecordSyntax;
100 int replaceIndicator;
103 int smallSetUpperBound;
104 int largeSetLowerBound;
105 int mediumSetPresentNumber;
118 int preferredMessageSize;
119 int maximumRecordSize;
121 Odr_bitmask protocolVersion;
123 char *idAuthenticationOpen;
124 char *idAuthenticationGroupId;
125 char *idAuthenticationUserId;
126 char *idAuthenticationPassword;
128 char *implementationName;
129 char *implementationId;
130 char *implementationVersion;
132 char *targetImplementationName;
133 char *targetImplementationId;
134 char *targetImplementationVersion;
135 char *userInformationField;
152 struct IrTcl_Request_ *request_queue;
154 IrTcl_SetCObj set_inher;
157 typedef struct IrTcl_Request_ {
158 struct IrTcl_Request_ *next;
173 struct GRS_Record_entry {
182 struct IrTcl_GRS_Record_ *sub;
193 typedef struct IrTcl_GRS_Record_ {
195 struct GRS_Record_entry *entries;
198 typedef struct IrTcl_RecordList_ {
206 IrTcl_GRS_Record *grs1;
212 IrTcl_Diagnostic *list;
213 } surrogateDiagnostics;
215 struct IrTcl_RecordList_ *next;
218 typedef struct IrTcl_SetObj_ {
223 int nextResultSetPosition;
226 int numberOfRecordsReturned;
230 int nonSurrogateDiagnosticNum;
231 IrTcl_Diagnostic *nonSurrogateDiagnosticList;
232 IrTcl_RecordList *record_list;
233 IrTcl_SetCObj set_inher;
236 typedef struct IrTcl_ScanEntry_ {
241 int globalOccurrences;
244 IrTcl_Diagnostic *list;
250 typedef struct IrTcl_ScanObj_ {
253 int numberOfTermsRequested;
254 int preferredPositionInResponse;
257 int numberOfEntriesReturned;
266 IrTcl_ScanEntry *entries;
267 IrTcl_Diagnostic *nonSurrogateDiagnosticList;
268 int nonSurrogateDiagnosticNum;
271 struct ir_named_entry {
276 int ir_tcl_get_marc (Tcl_Interp *interp, const char *buf,
277 int argc, char **argv);
278 int ir_tcl_send_APDU (Tcl_Interp *interp, IrTcl_Obj *p, Z_APDU *apdu,
279 const char *msg, const char *object_name);
280 int ir_tcl_send_q (IrTcl_Obj *p, IrTcl_Request *rq, const char *msg);
281 void ir_tcl_del_q (IrTcl_Obj *p);
282 void *ir_tcl_malloc (size_t size);
283 int ir_tcl_strdup (Tcl_Interp *interp, char** p, const char *s);
284 int ir_tcl_strdel (Tcl_Interp *interp, char **p);
286 char *ir_tcl_fread_marc (FILE *inf, size_t *size);
287 void ir_tcl_read_grs (Z_GenericRecord *r, IrTcl_GRS_Record **grs_record);
288 int ir_tcl_get_grs (Tcl_Interp *interp, IrTcl_GRS_Record *grs_record,
289 int argc, char **argv);
291 #define IR_TCL_FAIL_CONNECT 1
292 #define IR_TCL_FAIL_READ 2
293 #define IR_TCL_FAIL_WRITE 3
294 #define IR_TCL_FAIL_IN_APDU 4
295 #define IR_TCL_FAIL_UNKNOWN_APDU 5
297 #define IR_TCL_R_Idle 0
298 #define IR_TCL_R_Writing 1
299 #define IR_TCL_R_Waiting 2
300 #define IR_TCL_R_Reading 3
301 #define IR_TCL_R_Connecting 4