2 * IR toolkit for tcl/tk
4 * See the file LICENSE for details.
5 * Sebastian Hammer, Adam Dickmeiss
8 * Revision 1.18 1995-10-18 16:42:44 adam
9 * New settings: smallSetElementSetNames and mediumSetElementSetNames.
11 * Revision 1.17 1995/10/16 17:00:56 adam
12 * New setting: elementSetNames.
13 * Various client improvements. Medium presentation format looks better.
15 * Revision 1.16 1995/09/20 11:37:01 adam
16 * Configure searches for tk4.1 and tk7.5.
19 * Revision 1.15 1995/08/29 15:30:15 adam
20 * Work on GRS records.
22 * Revision 1.14 1995/08/04 11:32:40 adam
23 * More work on output queue. Memory related routines moved
26 * Revision 1.13 1995/08/03 13:23:00 adam
29 * Revision 1.12 1995/07/28 10:28:38 adam
30 * First work on request queue.
32 * Revision 1.11 1995/06/20 08:07:35 adam
33 * New setting: failInfo.
34 * Working on better cancel mechanism.
36 * Revision 1.10 1995/06/16 12:28:20 adam
37 * Implemented preferredRecordSyntax.
38 * Minor changes in diagnostic handling.
39 * Record list deleted when connection closes.
41 * Revision 1.9 1995/06/14 15:08:01 adam
42 * Bug fix in cascade-target-list. Uses yaz-version.h.
44 * Revision 1.8 1995/06/14 13:37:18 adam
45 * Setting recordType implemented.
46 * Setting implementationVersion implemented.
47 * Settings implementationId / implementationName edited.
49 * Revision 1.7 1995/06/01 07:31:28 adam
50 * Rename of many typedefs -> IrTcl_...
52 * Revision 1.6 1995/05/31 08:36:40 adam
53 * Bug fix in client.tcl: didn't save options on clientrc.tcl.
54 * New method: referenceId. More work on scan.
56 * Revision 1.5 1995/05/29 08:44:25 adam
57 * Work on delete of objects.
59 * Revision 1.4 1995/05/26 11:44:10 adam
60 * Bugs fixed. More work on MARC utilities and queries. Test
61 * client is up-to-date again.
63 * Revision 1.3 1995/05/26 08:54:17 adam
64 * New MARC utilities. Uses prefix query.
66 * Revision 1.2 1995/05/24 14:10:23 adam
67 * Work on idAuthentication, protocolVersion and options.
69 * Revision 1.1 1995/05/23 15:34:49 adam
70 * Many new settings, userInformationField, smallSetUpperBound, etc.
71 * A number of settings are inherited when ir-set is executed.
72 * This version is incompatible with the graphical test client (client.tcl).
94 #include <yaz-version.h>
103 char **databaseNames;
104 int num_databaseNames;
106 enum oid_value *preferredRecordSyntax;
107 int replaceIndicator;
110 char *elementSetNames;
111 char *smallSetElementSetNames;
112 char *mediumSetElementSetNames;
114 int smallSetUpperBound;
115 int largeSetLowerBound;
116 int mediumSetPresentNumber;
129 int preferredMessageSize;
130 int maximumRecordSize;
132 Odr_bitmask protocolVersion;
134 char *idAuthenticationOpen;
135 char *idAuthenticationGroupId;
136 char *idAuthenticationUserId;
137 char *idAuthenticationPassword;
139 char *implementationName;
140 char *implementationId;
141 char *implementationVersion;
143 char *targetImplementationName;
144 char *targetImplementationId;
145 char *targetImplementationVersion;
146 char *userInformationField;
163 struct IrTcl_Request_ *request_queue;
165 IrTcl_SetCObj set_inher;
168 typedef struct IrTcl_Request_ {
169 struct IrTcl_Request_ *next;
184 struct GRS_Record_entry {
193 struct IrTcl_GRS_Record_ *sub;
204 typedef struct IrTcl_GRS_Record_ {
206 struct GRS_Record_entry *entries;
209 typedef struct IrTcl_RecordList_ {
217 IrTcl_GRS_Record *grs1;
223 IrTcl_Diagnostic *list;
224 } surrogateDiagnostics;
226 struct IrTcl_RecordList_ *next;
229 typedef struct IrTcl_SetObj_ {
234 int nextResultSetPosition;
237 int numberOfRecordsReturned;
241 int nonSurrogateDiagnosticNum;
242 IrTcl_Diagnostic *nonSurrogateDiagnosticList;
243 IrTcl_RecordList *record_list;
244 IrTcl_SetCObj set_inher;
247 typedef struct IrTcl_ScanEntry_ {
252 int globalOccurrences;
255 IrTcl_Diagnostic *list;
261 typedef struct IrTcl_ScanObj_ {
264 int numberOfTermsRequested;
265 int preferredPositionInResponse;
268 int numberOfEntriesReturned;
277 IrTcl_ScanEntry *entries;
278 IrTcl_Diagnostic *nonSurrogateDiagnosticList;
279 int nonSurrogateDiagnosticNum;
282 struct ir_named_entry {
287 int ir_tcl_get_marc (Tcl_Interp *interp, const char *buf,
288 int argc, char **argv);
289 int ir_tcl_send_APDU (Tcl_Interp *interp, IrTcl_Obj *p, Z_APDU *apdu,
290 const char *msg, const char *object_name);
291 int ir_tcl_send_q (IrTcl_Obj *p, IrTcl_Request *rq, const char *msg);
292 void ir_tcl_del_q (IrTcl_Obj *p);
293 void *ir_tcl_malloc (size_t size);
294 int ir_tcl_strdup (Tcl_Interp *interp, char** p, const char *s);
295 int ir_tcl_strdel (Tcl_Interp *interp, char **p);
297 char *ir_tcl_fread_marc (FILE *inf, size_t *size);
298 void ir_tcl_read_grs (Z_GenericRecord *r, IrTcl_GRS_Record **grs_record);
299 int ir_tcl_get_grs (Tcl_Interp *interp, IrTcl_GRS_Record *grs_record,
300 int argc, char **argv);
302 #define IR_TCL_FAIL_CONNECT 1
303 #define IR_TCL_FAIL_READ 2
304 #define IR_TCL_FAIL_WRITE 3
305 #define IR_TCL_FAIL_IN_APDU 4
306 #define IR_TCL_FAIL_UNKNOWN_APDU 5
308 #define IR_TCL_R_Idle 0
309 #define IR_TCL_R_Writing 1
310 #define IR_TCL_R_Waiting 2
311 #define IR_TCL_R_Reading 3
312 #define IR_TCL_R_Connecting 4