2 * IR toolkit for tcl/tk
4 * See the file LICENSE for details.
5 * Sebastian Hammer, Adam Dickmeiss
8 * Revision 1.21 1996-01-04 16:12:14 adam
9 * Setting PDUType renamed to eventType.
11 * Revision 1.20 1996/01/04 11:05:23 adam
12 * New setting: PDUType - returns type of last PDU returned from the target.
13 * Fixed a bug in configure/Makefile.
15 * Revision 1.19 1995/11/13 09:55:46 adam
16 * Multiple records at a position in a result-set with differnt
19 * Revision 1.18 1995/10/18 16:42:44 adam
20 * New settings: smallSetElementSetNames and mediumSetElementSetNames.
22 * Revision 1.17 1995/10/16 17:00:56 adam
23 * New setting: elementSetNames.
24 * Various client improvements. Medium presentation format looks better.
26 * Revision 1.16 1995/09/20 11:37:01 adam
27 * Configure searches for tk4.1 and tk7.5.
30 * Revision 1.15 1995/08/29 15:30:15 adam
31 * Work on GRS records.
33 * Revision 1.14 1995/08/04 11:32:40 adam
34 * More work on output queue. Memory related routines moved
37 * Revision 1.13 1995/08/03 13:23:00 adam
40 * Revision 1.12 1995/07/28 10:28:38 adam
41 * First work on request queue.
43 * Revision 1.11 1995/06/20 08:07:35 adam
44 * New setting: failInfo.
45 * Working on better cancel mechanism.
47 * Revision 1.10 1995/06/16 12:28:20 adam
48 * Implemented preferredRecordSyntax.
49 * Minor changes in diagnostic handling.
50 * Record list deleted when connection closes.
52 * Revision 1.9 1995/06/14 15:08:01 adam
53 * Bug fix in cascade-target-list. Uses yaz-version.h.
55 * Revision 1.8 1995/06/14 13:37:18 adam
56 * Setting recordType implemented.
57 * Setting implementationVersion implemented.
58 * Settings implementationId / implementationName edited.
60 * Revision 1.7 1995/06/01 07:31:28 adam
61 * Rename of many typedefs -> IrTcl_...
63 * Revision 1.6 1995/05/31 08:36:40 adam
64 * Bug fix in client.tcl: didn't save options on clientrc.tcl.
65 * New method: referenceId. More work on scan.
67 * Revision 1.5 1995/05/29 08:44:25 adam
68 * Work on delete of objects.
70 * Revision 1.4 1995/05/26 11:44:10 adam
71 * Bugs fixed. More work on MARC utilities and queries. Test
72 * client is up-to-date again.
74 * Revision 1.3 1995/05/26 08:54:17 adam
75 * New MARC utilities. Uses prefix query.
77 * Revision 1.2 1995/05/24 14:10:23 adam
78 * Work on idAuthentication, protocolVersion and options.
80 * Revision 1.1 1995/05/23 15:34:49 adam
81 * Many new settings, userInformationField, smallSetUpperBound, etc.
82 * A number of settings are inherited when ir-set is executed.
83 * This version is incompatible with the graphical test client (client.tcl).
105 #include <yaz-version.h>
109 #include <diagbib1.h>
114 char **databaseNames;
115 int num_databaseNames;
117 enum oid_value *preferredRecordSyntax;
118 int replaceIndicator;
121 char *elementSetNames;
122 char *smallSetElementSetNames;
123 char *mediumSetElementSetNames;
125 int smallSetUpperBound;
126 int largeSetLowerBound;
127 int mediumSetPresentNumber;
140 int preferredMessageSize;
141 int maximumRecordSize;
143 Odr_bitmask protocolVersion;
145 char *idAuthenticationOpen;
146 char *idAuthenticationGroupId;
147 char *idAuthenticationUserId;
148 char *idAuthenticationPassword;
150 char *implementationName;
151 char *implementationId;
152 char *implementationVersion;
154 char *targetImplementationName;
155 char *targetImplementationId;
156 char *targetImplementationVersion;
157 char *userInformationField;
175 struct IrTcl_Request_ *request_queue;
177 IrTcl_SetCObj set_inher;
180 typedef struct IrTcl_Request_ {
181 struct IrTcl_Request_ *next;
196 struct GRS_Record_entry {
205 struct IrTcl_GRS_Record_ *sub;
216 typedef struct IrTcl_GRS_Record_ {
218 struct GRS_Record_entry *entries;
221 typedef struct IrTcl_RecordList_ {
230 IrTcl_GRS_Record *grs1;
236 IrTcl_Diagnostic *list;
237 } surrogateDiagnostics;
239 struct IrTcl_RecordList_ *next;
242 typedef struct IrTcl_SetObj_ {
247 int nextResultSetPosition;
250 int numberOfRecordsReturned;
252 char *recordElements;
255 int nonSurrogateDiagnosticNum;
256 IrTcl_Diagnostic *nonSurrogateDiagnosticList;
257 IrTcl_RecordList *record_list;
258 IrTcl_SetCObj set_inher;
261 typedef struct IrTcl_ScanEntry_ {
266 int globalOccurrences;
269 IrTcl_Diagnostic *list;
275 typedef struct IrTcl_ScanObj_ {
278 int numberOfTermsRequested;
279 int preferredPositionInResponse;
282 int numberOfEntriesReturned;
291 IrTcl_ScanEntry *entries;
292 IrTcl_Diagnostic *nonSurrogateDiagnosticList;
293 int nonSurrogateDiagnosticNum;
296 struct ir_named_entry {
301 int ir_tcl_get_marc (Tcl_Interp *interp, const char *buf,
302 int argc, char **argv);
303 int ir_tcl_send_APDU (Tcl_Interp *interp, IrTcl_Obj *p, Z_APDU *apdu,
304 const char *msg, const char *object_name);
305 int ir_tcl_send_q (IrTcl_Obj *p, IrTcl_Request *rq, const char *msg);
306 void ir_tcl_del_q (IrTcl_Obj *p);
307 void *ir_tcl_malloc (size_t size);
308 int ir_tcl_strdup (Tcl_Interp *interp, char** p, const char *s);
309 int ir_tcl_strdel (Tcl_Interp *interp, char **p);
311 char *ir_tcl_fread_marc (FILE *inf, size_t *size);
312 void ir_tcl_read_grs (Z_GenericRecord *r, IrTcl_GRS_Record **grs_record);
313 int ir_tcl_get_grs (Tcl_Interp *interp, IrTcl_GRS_Record *grs_record,
314 int argc, char **argv);
316 #define IR_TCL_FAIL_CONNECT 1
317 #define IR_TCL_FAIL_READ 2
318 #define IR_TCL_FAIL_WRITE 3
319 #define IR_TCL_FAIL_IN_APDU 4
320 #define IR_TCL_FAIL_UNKNOWN_APDU 5
322 #define IR_TCL_R_Idle 0
323 #define IR_TCL_R_Writing 1
324 #define IR_TCL_R_Waiting 2
325 #define IR_TCL_R_Reading 3
326 #define IR_TCL_R_Connecting 4