2 * IR toolkit for tcl/tk
4 * See the file LICENSE for details.
5 * Sebastian Hammer, Adam Dickmeiss
8 * Revision 1.14 1995-08-04 11:32:40 adam
9 * More work on output queue. Memory related routines moved
12 * Revision 1.13 1995/08/03 13:23:00 adam
15 * Revision 1.12 1995/07/28 10:28:38 adam
16 * First work on request queue.
18 * Revision 1.11 1995/06/20 08:07:35 adam
19 * New setting: failInfo.
20 * Working on better cancel mechanism.
22 * Revision 1.10 1995/06/16 12:28:20 adam
23 * Implemented preferredRecordSyntax.
24 * Minor changes in diagnostic handling.
25 * Record list deleted when connection closes.
27 * Revision 1.9 1995/06/14 15:08:01 adam
28 * Bug fix in cascade-target-list. Uses yaz-version.h.
30 * Revision 1.8 1995/06/14 13:37:18 adam
31 * Setting recordType implemented.
32 * Setting implementationVersion implemented.
33 * Settings implementationId / implementationName edited.
35 * Revision 1.7 1995/06/01 07:31:28 adam
36 * Rename of many typedefs -> IrTcl_...
38 * Revision 1.6 1995/05/31 08:36:40 adam
39 * Bug fix in client.tcl: didn't save options on clientrc.tcl.
40 * New method: referenceId. More work on scan.
42 * Revision 1.5 1995/05/29 08:44:25 adam
43 * Work on delete of objects.
45 * Revision 1.4 1995/05/26 11:44:10 adam
46 * Bugs fixed. More work on MARC utilities and queries. Test
47 * client is up-to-date again.
49 * Revision 1.3 1995/05/26 08:54:17 adam
50 * New MARC utilities. Uses prefix query.
52 * Revision 1.2 1995/05/24 14:10:23 adam
53 * Work on idAuthentication, protocolVersion and options.
55 * Revision 1.1 1995/05/23 15:34:49 adam
56 * Many new settings, userInformationField, smallSetUpperBound, etc.
57 * A number of settings are inherited when ir-set is executed.
58 * This version is incompatible with the graphical test client (client.tcl).
80 #include <yaz-version.h>
90 int num_databaseNames;
92 enum oid_value *preferredRecordSyntax;
96 int smallSetUpperBound;
97 int largeSetLowerBound;
98 int mediumSetPresentNumber;
111 int preferredMessageSize;
112 int maximumRecordSize;
114 Odr_bitmask protocolVersion;
116 char *idAuthenticationOpen;
117 char *idAuthenticationGroupId;
118 char *idAuthenticationUserId;
119 char *idAuthenticationPassword;
121 char *implementationName;
122 char *implementationId;
123 char *implementationVersion;
125 char *targetImplementationName;
126 char *targetImplementationId;
127 char *targetImplementationVersion;
128 char *userInformationField;
145 struct IrTcl_Request_ *request_queue;
147 IrTcl_SetCObj set_inher;
150 typedef struct IrTcl_Request_ {
151 struct IrTcl_Request_ *next;
166 typedef struct IrTcl_RecordList_ {
177 IrTcl_Diagnostic *list;
178 } surrogateDiagnostics;
180 struct IrTcl_RecordList_ *next;
183 typedef struct IrTcl_SetObj_ {
188 int nextResultSetPosition;
191 int numberOfRecordsReturned;
195 int nonSurrogateDiagnosticNum;
196 IrTcl_Diagnostic *nonSurrogateDiagnosticList;
197 IrTcl_RecordList *record_list;
198 IrTcl_SetCObj set_inher;
201 typedef struct IrTcl_ScanEntry_ {
206 int globalOccurrences;
209 IrTcl_Diagnostic *list;
215 typedef struct IrTcl_ScanObj_ {
218 int numberOfTermsRequested;
219 int preferredPositionInResponse;
222 int numberOfEntriesReturned;
231 IrTcl_ScanEntry *entries;
232 IrTcl_Diagnostic *nonSurrogateDiagnosticList;
233 int nonSurrogateDiagnosticNum;
236 struct ir_named_entry {
241 int ir_tcl_get_marc (Tcl_Interp *interp, const char *buf,
242 int argc, char **argv);
243 int ir_tcl_send_APDU (Tcl_Interp *interp, IrTcl_Obj *p, Z_APDU *apdu,
244 const char *msg, const char *object_name);
245 int ir_tcl_send_q (IrTcl_Obj *p, IrTcl_Request *rq, const char *msg);
246 void ir_tcl_del_q (IrTcl_Obj *p);
247 void *ir_tcl_malloc (size_t size);
248 int ir_tcl_strdup (Tcl_Interp *interp, char** p, const char *s);
249 int ir_tcl_strdel (Tcl_Interp *interp, char **p);
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