2 * IR toolkit for tcl/tk
4 * See the file LICENSE for details.
5 * Sebastian Hammer, Adam Dickmeiss
8 * Revision 1.13 1995-08-03 13:23:00 adam
11 * Revision 1.12 1995/07/28 10:28:38 adam
12 * First work on request queue.
14 * Revision 1.11 1995/06/20 08:07:35 adam
15 * New setting: failInfo.
16 * Working on better cancel mechanism.
18 * Revision 1.10 1995/06/16 12:28:20 adam
19 * Implemented preferredRecordSyntax.
20 * Minor changes in diagnostic handling.
21 * Record list deleted when connection closes.
23 * Revision 1.9 1995/06/14 15:08:01 adam
24 * Bug fix in cascade-target-list. Uses yaz-version.h.
26 * Revision 1.8 1995/06/14 13:37:18 adam
27 * Setting recordType implemented.
28 * Setting implementationVersion implemented.
29 * Settings implementationId / implementationName edited.
31 * Revision 1.7 1995/06/01 07:31:28 adam
32 * Rename of many typedefs -> IrTcl_...
34 * Revision 1.6 1995/05/31 08:36:40 adam
35 * Bug fix in client.tcl: didn't save options on clientrc.tcl.
36 * New method: referenceId. More work on scan.
38 * Revision 1.5 1995/05/29 08:44:25 adam
39 * Work on delete of objects.
41 * Revision 1.4 1995/05/26 11:44:10 adam
42 * Bugs fixed. More work on MARC utilities and queries. Test
43 * client is up-to-date again.
45 * Revision 1.3 1995/05/26 08:54:17 adam
46 * New MARC utilities. Uses prefix query.
48 * Revision 1.2 1995/05/24 14:10:23 adam
49 * Work on idAuthentication, protocolVersion and options.
51 * Revision 1.1 1995/05/23 15:34:49 adam
52 * Many new settings, userInformationField, smallSetUpperBound, etc.
53 * A number of settings are inherited when ir-set is executed.
54 * This version is incompatible with the graphical test client (client.tcl).
76 #include <yaz-version.h>
86 int num_databaseNames;
88 enum oid_value *preferredRecordSyntax;
92 int smallSetUpperBound;
93 int largeSetLowerBound;
94 int mediumSetPresentNumber;
107 int preferredMessageSize;
108 int maximumRecordSize;
110 Odr_bitmask protocolVersion;
112 char *idAuthenticationOpen;
113 char *idAuthenticationGroupId;
114 char *idAuthenticationUserId;
115 char *idAuthenticationPassword;
117 char *implementationName;
118 char *implementationId;
119 char *implementationVersion;
121 char *targetImplementationName;
122 char *targetImplementationId;
123 char *targetImplementationVersion;
124 char *userInformationField;
146 struct IrTcl_SetObj_ *set_child;
147 struct IrTcl_ScanObj_ *scan_child;
148 struct IrTcl_Request_ *request_queue;
150 IrTcl_SetCObj set_inher;
153 typedef struct IrTcl_Request_ {
154 char *name_of_object;
155 struct IrTcl_Request_ *next;
170 typedef struct IrTcl_RecordList_ {
181 IrTcl_Diagnostic *list;
182 } surrogateDiagnostics;
184 struct IrTcl_RecordList_ *next;
187 typedef struct IrTcl_SetObj_ {
192 int nextResultSetPosition;
195 int numberOfRecordsReturned;
199 int nonSurrogateDiagnosticNum;
200 IrTcl_Diagnostic *nonSurrogateDiagnosticList;
201 IrTcl_RecordList *record_list;
202 IrTcl_SetCObj set_inher;
205 typedef struct IrTcl_ScanEntry_ {
210 int globalOccurrences;
213 IrTcl_Diagnostic *list;
219 typedef struct IrTcl_ScanObj_ {
222 int numberOfTermsRequested;
223 int preferredPositionInResponse;
226 int numberOfEntriesReturned;
235 IrTcl_ScanEntry *entries;
236 IrTcl_Diagnostic *nonSurrogateDiagnosticList;
237 int nonSurrogateDiagnosticNum;
240 struct ir_named_entry {
245 int ir_tcl_get_marc (Tcl_Interp *interp, const char *buf,
246 int argc, char **argv);
247 int ir_tcl_send_APDU (Tcl_Interp *interp, IrTcl_Obj *p, Z_APDU *apdu,
249 int ir_tcl_send_q (IrTcl_Obj *p, IrTcl_Request *rq, const char *msg);
251 char *ir_tcl_fread_marc (FILE *inf, size_t *size);
253 #define IR_TCL_FAIL_CONNECT 1
254 #define IR_TCL_FAIL_READ 2
255 #define IR_TCL_FAIL_WRITE 3
256 #define IR_TCL_FAIL_IN_APDU 4
257 #define IR_TCL_FAIL_UNKNOWN_APDU 5
259 #define IR_TCL_R_Idle 0
260 #define IR_TCL_R_Writing 1
261 #define IR_TCL_R_Waiting 2
262 #define IR_TCL_R_Reading 3
263 #define IR_TCL_R_Connecting 4