2 * IR toolkit for tcl/tk
4 * See the file LICENSE for details.
5 * Sebastian Hammer, Adam Dickmeiss
8 * Revision 1.15 1995-08-29 15:30:15 adam
11 * Revision 1.14 1995/08/04 11:32:40 adam
12 * More work on output queue. Memory related routines moved
15 * Revision 1.13 1995/08/03 13:23:00 adam
18 * Revision 1.12 1995/07/28 10:28:38 adam
19 * First work on request queue.
21 * Revision 1.11 1995/06/20 08:07:35 adam
22 * New setting: failInfo.
23 * Working on better cancel mechanism.
25 * Revision 1.10 1995/06/16 12:28:20 adam
26 * Implemented preferredRecordSyntax.
27 * Minor changes in diagnostic handling.
28 * Record list deleted when connection closes.
30 * Revision 1.9 1995/06/14 15:08:01 adam
31 * Bug fix in cascade-target-list. Uses yaz-version.h.
33 * Revision 1.8 1995/06/14 13:37:18 adam
34 * Setting recordType implemented.
35 * Setting implementationVersion implemented.
36 * Settings implementationId / implementationName edited.
38 * Revision 1.7 1995/06/01 07:31:28 adam
39 * Rename of many typedefs -> IrTcl_...
41 * Revision 1.6 1995/05/31 08:36:40 adam
42 * Bug fix in client.tcl: didn't save options on clientrc.tcl.
43 * New method: referenceId. More work on scan.
45 * Revision 1.5 1995/05/29 08:44:25 adam
46 * Work on delete of objects.
48 * Revision 1.4 1995/05/26 11:44:10 adam
49 * Bugs fixed. More work on MARC utilities and queries. Test
50 * client is up-to-date again.
52 * Revision 1.3 1995/05/26 08:54:17 adam
53 * New MARC utilities. Uses prefix query.
55 * Revision 1.2 1995/05/24 14:10:23 adam
56 * Work on idAuthentication, protocolVersion and options.
58 * Revision 1.1 1995/05/23 15:34:49 adam
59 * Many new settings, userInformationField, smallSetUpperBound, etc.
60 * A number of settings are inherited when ir-set is executed.
61 * This version is incompatible with the graphical test client (client.tcl).
83 #include <yaz-version.h>
93 int num_databaseNames;
95 enum oid_value *preferredRecordSyntax;
99 int smallSetUpperBound;
100 int largeSetLowerBound;
101 int mediumSetPresentNumber;
114 int preferredMessageSize;
115 int maximumRecordSize;
117 Odr_bitmask protocolVersion;
119 char *idAuthenticationOpen;
120 char *idAuthenticationGroupId;
121 char *idAuthenticationUserId;
122 char *idAuthenticationPassword;
124 char *implementationName;
125 char *implementationId;
126 char *implementationVersion;
128 char *targetImplementationName;
129 char *targetImplementationId;
130 char *targetImplementationVersion;
131 char *userInformationField;
148 struct IrTcl_Request_ *request_queue;
150 IrTcl_SetCObj set_inher;
153 typedef struct IrTcl_Request_ {
154 struct IrTcl_Request_ *next;
169 struct GRS_Record_entry {
178 struct IrTcl_GRS_Record_ *sub;
183 typedef struct IrTcl_GRS_Record_ {
185 struct GRS_Record_entry *entries;
188 typedef struct IrTcl_RecordList_ {
196 IrTcl_GRS_Record *grs1;
202 IrTcl_Diagnostic *list;
203 } surrogateDiagnostics;
205 struct IrTcl_RecordList_ *next;
208 typedef struct IrTcl_SetObj_ {
213 int nextResultSetPosition;
216 int numberOfRecordsReturned;
220 int nonSurrogateDiagnosticNum;
221 IrTcl_Diagnostic *nonSurrogateDiagnosticList;
222 IrTcl_RecordList *record_list;
223 IrTcl_SetCObj set_inher;
226 typedef struct IrTcl_ScanEntry_ {
231 int globalOccurrences;
234 IrTcl_Diagnostic *list;
240 typedef struct IrTcl_ScanObj_ {
243 int numberOfTermsRequested;
244 int preferredPositionInResponse;
247 int numberOfEntriesReturned;
256 IrTcl_ScanEntry *entries;
257 IrTcl_Diagnostic *nonSurrogateDiagnosticList;
258 int nonSurrogateDiagnosticNum;
261 struct ir_named_entry {
266 int ir_tcl_get_marc (Tcl_Interp *interp, const char *buf,
267 int argc, char **argv);
268 int ir_tcl_send_APDU (Tcl_Interp *interp, IrTcl_Obj *p, Z_APDU *apdu,
269 const char *msg, const char *object_name);
270 int ir_tcl_send_q (IrTcl_Obj *p, IrTcl_Request *rq, const char *msg);
271 void ir_tcl_del_q (IrTcl_Obj *p);
272 void *ir_tcl_malloc (size_t size);
273 int ir_tcl_strdup (Tcl_Interp *interp, char** p, const char *s);
274 int ir_tcl_strdel (Tcl_Interp *interp, char **p);
276 char *ir_tcl_fread_marc (FILE *inf, size_t *size);
277 void ir_tcl_read_grs (Z_GenericRecord *r, IrTcl_GRS_Record **grs_record);
278 int ir_tcl_get_grs (Tcl_Interp *interp, IrTcl_GRS_Record *grs_record,
279 int argc, char **argv);
281 #define IR_TCL_FAIL_CONNECT 1
282 #define IR_TCL_FAIL_READ 2
283 #define IR_TCL_FAIL_WRITE 3
284 #define IR_TCL_FAIL_IN_APDU 4
285 #define IR_TCL_FAIL_UNKNOWN_APDU 5
287 #define IR_TCL_R_Idle 0
288 #define IR_TCL_R_Writing 1
289 #define IR_TCL_R_Waiting 2
290 #define IR_TCL_R_Reading 3
291 #define IR_TCL_R_Connecting 4