X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=ir-tcl.c;h=c579222748769b2a2340fe7b54577f4d3e590719;hb=6478756d2480cf10f7954addb3f1e96673e2c9e0;hp=591914d76fa6118e981b1f8ccdb962e23af1060b;hpb=1dacbb936d32d0fc313535d511f7ccdefa0078dc;p=ir-tcl-moved-to-github.git diff --git a/ir-tcl.c b/ir-tcl.c index 591914d..c579222 100644 --- a/ir-tcl.c +++ b/ir-tcl.c @@ -5,7 +5,13 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ir-tcl.c,v $ - * Revision 1.106 1998-05-20 12:25:35 adam + * 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. * @@ -657,13 +663,14 @@ int ir_tcl_named_bits (struct ir_named_entry *tab, Odr_bitmask *ob, ODR_MASK_ZERO (ob); for (no = 0; no < argc; no++) { + int ok = 0; for (ti = tab; ti->name; ti++) - if (!strcmp (argv[no], ti->name)) + if (!strcmp(argv[no], "@all") || !strcmp (argv[no], ti->name)) { ODR_MASK_SET (ob, ti->pos); - break; + ok = 1; } - if (!ti->name) + if (!ok) { Tcl_AppendResult (interp, "bad bit mask ", argv[no], NULL); return ir_tcl_error_exec (interp, argc, argv); @@ -3334,7 +3341,6 @@ static int do_scanLine (void *obj, Tcl_Interp *interp, int argc, char **argv) " position\"", NULL); return TCL_ERROR; } - printf ("argv[2]=%s\n", argv[2]); if (Tcl_GetInt (interp, argv[2], &i) == TCL_ERROR) return TCL_ERROR; if (!p->entries_flag || !p->entries || i >= p->num_entries || i < 0) @@ -3489,6 +3495,18 @@ static int ir_log_proc (ClientData clientData, Tcl_Interp *interp, } +/* + * ir_version: log ir version + */ +static int ir_version (ClientData clientData, Tcl_Interp *interp, + int argc, char **argv) +{ + Tcl_AppendElement (interp, IR_TCL_VERSION); + Tcl_AppendElement (interp, YAZ_VERSION); + return TCL_OK; +} + + /* ------------------------------------------------------- */ static void ir_initResponse (void *obj, Z_InitResponse *initrs) { @@ -4203,6 +4221,8 @@ EXPORT (int,Irtcl_Init) (Tcl_Interp *interp) (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); Tcl_CreateCommand (interp, "ir-log", ir_log_proc, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); + Tcl_CreateCommand (interp, "ir-version", ir_version, (ClientData) NULL, + (Tcl_CmdDeleteProc *) NULL); nmem_init (); return TCL_OK; }