2 * IR toolkit for tcl/tk
4 * See the file LICENSE for details.
5 * Sebastian Hammer, Adam Dickmeiss
8 * Revision 1.17 1995-10-16 17:00:56 adam
9 * New setting: elementSetNames.
10 * Various client improvements. Medium presentation format looks better.
12 * Revision 1.16 1995/09/20 11:37:01 adam
13 * Configure searches for tk4.1 and tk7.5.
16 * Revision 1.15 1995/08/29 15:30:15 adam
17 * Work on GRS records.
19 * Revision 1.14 1995/08/04 11:32:40 adam
20 * More work on output queue. Memory related routines moved
23 * Revision 1.13 1995/08/03 13:23:00 adam
26 * Revision 1.12 1995/07/28 10:28:38 adam
27 * First work on request queue.
29 * Revision 1.11 1995/06/20 08:07:35 adam
30 * New setting: failInfo.
31 * Working on better cancel mechanism.
33 * Revision 1.10 1995/06/16 12:28:20 adam
34 * Implemented preferredRecordSyntax.
35 * Minor changes in diagnostic handling.
36 * Record list deleted when connection closes.
38 * Revision 1.9 1995/06/14 15:08:01 adam
39 * Bug fix in cascade-target-list. Uses yaz-version.h.
41 * Revision 1.8 1995/06/14 13:37:18 adam
42 * Setting recordType implemented.
43 * Setting implementationVersion implemented.
44 * Settings implementationId / implementationName edited.
46 * Revision 1.7 1995/06/01 07:31:28 adam
47 * Rename of many typedefs -> IrTcl_...
49 * Revision 1.6 1995/05/31 08:36:40 adam
50 * Bug fix in client.tcl: didn't save options on clientrc.tcl.
51 * New method: referenceId. More work on scan.
53 * Revision 1.5 1995/05/29 08:44:25 adam
54 * Work on delete of objects.
56 * Revision 1.4 1995/05/26 11:44:10 adam
57 * Bugs fixed. More work on MARC utilities and queries. Test
58 * client is up-to-date again.
60 * Revision 1.3 1995/05/26 08:54:17 adam
61 * New MARC utilities. Uses prefix query.
63 * Revision 1.2 1995/05/24 14:10:23 adam
64 * Work on idAuthentication, protocolVersion and options.
66 * Revision 1.1 1995/05/23 15:34:49 adam
67 * Many new settings, userInformationField, smallSetUpperBound, etc.
68 * A number of settings are inherited when ir-set is executed.
69 * This version is incompatible with the graphical test client (client.tcl).
91 #include <yaz-version.h>
100 char **databaseNames;
101 int num_databaseNames;
103 enum oid_value *preferredRecordSyntax;
104 int replaceIndicator;
107 char *elementSetNames;
109 int smallSetUpperBound;
110 int largeSetLowerBound;
111 int mediumSetPresentNumber;
124 int preferredMessageSize;
125 int maximumRecordSize;
127 Odr_bitmask protocolVersion;
129 char *idAuthenticationOpen;
130 char *idAuthenticationGroupId;
131 char *idAuthenticationUserId;
132 char *idAuthenticationPassword;
134 char *implementationName;
135 char *implementationId;
136 char *implementationVersion;
138 char *targetImplementationName;
139 char *targetImplementationId;
140 char *targetImplementationVersion;
141 char *userInformationField;
158 struct IrTcl_Request_ *request_queue;
160 IrTcl_SetCObj set_inher;
163 typedef struct IrTcl_Request_ {
164 struct IrTcl_Request_ *next;
179 struct GRS_Record_entry {
188 struct IrTcl_GRS_Record_ *sub;
199 typedef struct IrTcl_GRS_Record_ {
201 struct GRS_Record_entry *entries;
204 typedef struct IrTcl_RecordList_ {
212 IrTcl_GRS_Record *grs1;
218 IrTcl_Diagnostic *list;
219 } surrogateDiagnostics;
221 struct IrTcl_RecordList_ *next;
224 typedef struct IrTcl_SetObj_ {
229 int nextResultSetPosition;
232 int numberOfRecordsReturned;
236 int nonSurrogateDiagnosticNum;
237 IrTcl_Diagnostic *nonSurrogateDiagnosticList;
238 IrTcl_RecordList *record_list;
239 IrTcl_SetCObj set_inher;
242 typedef struct IrTcl_ScanEntry_ {
247 int globalOccurrences;
250 IrTcl_Diagnostic *list;
256 typedef struct IrTcl_ScanObj_ {
259 int numberOfTermsRequested;
260 int preferredPositionInResponse;
263 int numberOfEntriesReturned;
272 IrTcl_ScanEntry *entries;
273 IrTcl_Diagnostic *nonSurrogateDiagnosticList;
274 int nonSurrogateDiagnosticNum;
277 struct ir_named_entry {
282 int ir_tcl_get_marc (Tcl_Interp *interp, const char *buf,
283 int argc, char **argv);
284 int ir_tcl_send_APDU (Tcl_Interp *interp, IrTcl_Obj *p, Z_APDU *apdu,
285 const char *msg, const char *object_name);
286 int ir_tcl_send_q (IrTcl_Obj *p, IrTcl_Request *rq, const char *msg);
287 void ir_tcl_del_q (IrTcl_Obj *p);
288 void *ir_tcl_malloc (size_t size);
289 int ir_tcl_strdup (Tcl_Interp *interp, char** p, const char *s);
290 int ir_tcl_strdel (Tcl_Interp *interp, char **p);
292 char *ir_tcl_fread_marc (FILE *inf, size_t *size);
293 void ir_tcl_read_grs (Z_GenericRecord *r, IrTcl_GRS_Record **grs_record);
294 int ir_tcl_get_grs (Tcl_Interp *interp, IrTcl_GRS_Record *grs_record,
295 int argc, char **argv);
297 #define IR_TCL_FAIL_CONNECT 1
298 #define IR_TCL_FAIL_READ 2
299 #define IR_TCL_FAIL_WRITE 3
300 #define IR_TCL_FAIL_IN_APDU 4
301 #define IR_TCL_FAIL_UNKNOWN_APDU 5
303 #define IR_TCL_R_Idle 0
304 #define IR_TCL_R_Writing 1
305 #define IR_TCL_R_Waiting 2
306 #define IR_TCL_R_Reading 3
307 #define IR_TCL_R_Connecting 4