+ * Revision 1.128 2005-03-10 13:54:56 adam
+ * Remove CCL support for scan
+ *
+ * Revision 1.127 2004/05/10 08:38:45 adam
+ * Do not use obsolete YAZ defines
+ *
+ * Revision 1.126 2003/11/29 17:24:09 adam
+ * Added getXml method (Franck Falcoz)
+ *
+ * Revision 1.125 2003/04/29 10:51:23 adam
+ * Null terminate octet aligned records
+ *
+ * Revision 1.124 2003/03/05 22:02:47 adam
+ * Add Tcl_InitStubs
+ *
+ * Revision 1.123 2003/03/05 21:21:41 adam
+ * APDU log. default largeSetLowerBound changed from 2 to 1
+ *
+ * Revision 1.122 2003/03/05 18:02:08 adam
+ * Fix bug with idAuthentication that didn't work for empty group.
+ *
+ * Revision 1.121 2003/01/30 13:27:07 adam
+ * Changed version to 1.4.1. Added WIN32 version resource.
+ * IrTcl ignores unexpected PDU's, rather than die.
+ *
+ * Revision 1.120 2002/03/20 14:48:54 adam
+ * implemented USR.1 SearchResult-1
+ *
+ * Revision 1.119 2001/12/03 00:31:06 adam
+ * Towards 1.4. Configure updates.
+ *
+ * Revision 1.118 2001/03/27 16:27:21 adam
+ * Fixed bug in do_responseStatus.
+ *
+ * Revision 1.117 2001/03/26 11:39:34 adam
+ * Fixed bug in ir_deleteDiags - crash when receiving multiple diags.
+ *
+ * Revision 1.116 2001/02/09 11:58:04 adam
+ * Updated for Tcl8.1 and higher where internal encoding is UTF-8.
+ *
+ * Revision 1.115 2000/09/13 12:18:49 adam
+ * Logging utility patch (YAZ version 1.7).
+ *
+ * Revision 1.114 1999/05/17 20:37:41 adam
+ * Fixed problem with ASN code.
+ *
+ * Revision 1.113 1999/04/20 10:01:46 adam
+ * Modified calls to ODR encoders/decoders (name argument).
+ *
+ * Revision 1.112 1999/03/22 06:51:34 adam
+ * Implemented sort.
+ *
+ * Revision 1.111 1999/02/11 11:30:09 adam
+ * Updated for WIN32.
+ *
+ * Revision 1.110 1998/10/20 15:15:31 adam
+ * Changed scan response handler.
+ *
+ * Revision 1.109 1998/10/13 21:23:26 adam
+ * Fixed searchStatus method.
+ *
+ * Revision 1.108 1998/10/12 11:48:08 adam
+ * Removed printf call.
+ *
+ * Revision 1.107 1998/06/10 13:00:46 adam
+ * Added ir-version command.
+ *
+ * Revision 1.106 1998/05/20 12:25:35 adam
+ * Fixed bug that occurred in rare cases when encoding of incoming
+ * records failed.
+ *
+ * Revision 1.105 1998/04/02 14:31:08 adam
+ * This version works with compiled ASN.1 code.
+ *
+ * Revision 1.104 1998/02/27 14:26:07 adam
+ * Changed client so that it still works if target sets numberOfRecords
+ * in response to an illegal value.
+ *
+ * Revision 1.103 1997/11/19 11:22:10 adam
+ * Object identifiers can be accessed in GRS-1 records.
+ *
+ * Revision 1.102 1997/09/17 12:22:40 adam
+ * Changed to use YAZ version 1.4. The new comstack utility, cs_straddr,
+ * is used.
+ *
+ * Revision 1.101 1997/09/09 10:19:53 adam
+ * New MSV5.0 port with fewer warnings.
+ *
+ * Revision 1.100 1997/05/01 15:04:05 adam
+ * Added ir-log command.
+ *
+ * Revision 1.99 1997/04/30 07:24:47 adam
+ * Spell fix of an error message.
+ *
+ * Revision 1.98 1997/04/13 18:57:20 adam
+ * Better error reporting and aligned with Tcl/Tk style.
+ * Rework of notifier code with Tcl_File handles.
+ *
+ * Revision 1.97 1996/11/14 17:11:07 adam
+ * Added Explain documentaion.
+ *
+ * Revision 1.96 1996/10/08 13:02:50 adam
+ * When dealing with records, odr_choice_enable_bias function is used to
+ * prevent decoding of externals.
+ *
+ * Revision 1.95 1996/09/13 10:51:49 adam
+ * Bug fix: ir_tcl_select_set called Tcl_GetFile at disconnect.
+ *
+ * Revision 1.94 1996/08/21 13:32:53 adam
+ * Implemented saveFile method and extended loadFile method to work with it.
+ *
+ * Revision 1.93 1996/08/16 15:07:45 adam
+ * First work on Explain.
+ *
+ * Revision 1.92 1996/08/09 15:33:07 adam
+ * Modified the code to use tk4.1/tcl7.5 patch level 1. The time-driven
+ * polling is no longer activated on Windows since asynchrounous I/O works
+ * better.
+ *
+ * Revision 1.91 1996/07/03 13:31:11 adam
+ * The xmalloc/xfree functions from YAZ are used to manage memory.
+ *
+ * Revision 1.90 1996/06/27 14:21:00 adam
+ * Yet another Windows port.
+ *
+ * Revision 1.89 1996/06/11 15:27:15 adam
+ * Event type set to connect a little earlier in the do_connect function.
+ *
+ * Revision 1.88 1996/06/03 09:04:22 adam
+ * Changed a few logf calls.
+ *
+ * Revision 1.87 1996/05/29 06:37:51 adam
+ * Function ir_tcl_get_grs_r enhanced so that specific elements can be
+ * extracted.
+ *
+ * Revision 1.86 1996/03/20 13:54:04 adam
+ * The Tcl_File structure is only manipulated in the Tk-event interface
+ * in tkinit.c.
+ *
+ * Revision 1.85 1996/03/15 11:15:48 adam
+ * Modified to use new prototypes for p_query_rpn and p_query_scan.
+ *
+ * Revision 1.84 1996/03/07 12:42:49 adam
+ * Better logging when callback is invoked.
+ *
+ * Revision 1.83 1996/03/05 09:21:09 adam
+ * Bug fix: memory used by GRS records wasn't freed.
+ * Rewrote some of the error handling code - the connection is always
+ * closed before failback is called.
+ * If failback is defined the send APDU methods (init, search, ...) will
+ * return OK but invoke failback (as is the case if the write operation
+ * fails).
+ * Bug fix: ref_count in assoc object could grow if fraction of PDU was
+ * read.
+ *
+ * Revision 1.82 1996/02/29 15:30:21 adam
+ * Export of IrTcl functionality to extensions.
+ *
+ * Revision 1.81 1996/02/26 18:38:32 adam
+ * Work on export of set methods.
+ *
+ * Revision 1.80 1996/02/23 17:31:39 adam
+ * More functions made available to the wais tcl extension.
+ *
+ * Revision 1.79 1996/02/23 13:41:38 adam
+ * Work on public access to simple ir class system.
+ *
+ * Revision 1.78 1996/02/21 10:16:08 adam
+ * Simplified select handling. Only one function ir_tcl_select_set has
+ * to be externally defined.
+ *
+ * Revision 1.77 1996/02/20 17:52:58 adam
+ * Uses the YAZ oid system to name record syntax object identifiers.
+ *
+ * Revision 1.76 1996/02/20 16:09:51 adam
+ * Bug fix: didn't set element set names stamp correctly on result
+ * set records when element set names were set to the empty string.
+ *
+ * Revision 1.75 1996/02/19 15:41:53 adam
+ * Better log messages.
+ * Minor improvement of connect method.
+ *
+ * Revision 1.74 1996/02/05 17:58:03 adam
+ * Ported ir-tcl to use the beta releases of tcl7.5/tk4.1.
+ *
+ * Revision 1.73 1996/01/29 11:35:19 adam
+ * Bug fix: cs_type member renamed to comstackType to avoid conflict with
+ * cs_type macro defined by YAZ.
+ *
+ * Revision 1.72 1996/01/19 17:45:34 quinn
+ * Added debugging output
+ *
+ * Revision 1.71 1996/01/19 16:22:38 adam
+ * New method: apduDump - returns information about last incoming APDU.
+ *
+ * Revision 1.70 1996/01/10 09:18:34 adam
+ * PDU specific callbacks implemented: initRespnse, searchResponse,
+ * presentResponse and scanResponse.
+ * Bug fix in the command line shell (tclmain.c) - discovered on OSF/1.
+ *
+ * Revision 1.69 1996/01/04 16:12:12 adam
+ * Setting PDUType renamed to eventType.
+ *
+ * Revision 1.68 1996/01/04 11:05:22 adam
+ * New setting: PDUType - returns type of last PDU returned from the target.
+ * Fixed a bug in configure/Makefile.
+ *
+ * Revision 1.67 1996/01/03 09:00:51 adam
+ * Updated to use new version of Yaz (names changed to avoid C++ conflict).
+ *
+ * Revision 1.66 1995/11/28 17:26:39 adam
+ * Removed Carriage return from ir-tcl.c!
+ * Removed misc. debug logs.
+ *
+ * Revision 1.65 1995/11/28 13:53:00 quinn
+ * Windows port.
+ *
+ * Revision 1.64 1995/11/13 15:39:18 adam
+ * Bug fix: {small,medium}SetElementSetNames weren't set correctly.
+ * Bug fix: idAuthentication weren't set correctly.
+ *
+ * Revision 1.63 1995/11/13 09:55:39 adam
+ * Multiple records at a position in a result-set with differnt
+ * element specs.
+ *
+ * Revision 1.62 1995/10/18 17:20:33 adam
+ * Work on target setup in client.tcl.
+ *
+ * Revision 1.61 1995/10/18 16:42:42 adam
+ * New settings: smallSetElementSetNames and mediumSetElementSetNames.
+ *
+ * Revision 1.60 1995/10/18 15:43:31 adam
+ * In search: mediumSetElementSetNames and smallSetElementSetNames are
+ * set to elementSetNames.
+ *
+ * Revision 1.59 1995/10/17 12:18:58 adam
+ * Bug fix: when target connection closed, the connection was not
+ * properly reestablished.
+ *
+ * Revision 1.58 1995/10/16 17:00:55 adam
+ * New setting: elementSetNames.
+ * Various client improvements. Medium presentation format looks better.
+ *
+ * Revision 1.57 1995/09/21 13:11:51 adam
+ * Support of dynamic loading.
+ * Test script uses load command if necessary.
+ *
+ * Revision 1.56 1995/08/29 15:30:14 adam