X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=ir-tcl.c;h=efccf01a949c85bcb73f745a5061af81cfb72e38;hb=de8b921d9c8c3757f8c166582c76315c53122d37;hp=4650a77297ff600d48e1e622d74a1013822ea09d;hpb=cbd2cc564f0ccf6623fcf382423b17e09f336eee;p=ir-tcl-moved-to-github.git diff --git a/ir-tcl.c b/ir-tcl.c index 4650a77..efccf01 100644 --- a/ir-tcl.c +++ b/ir-tcl.c @@ -5,7 +5,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ir-tcl.c,v $ - * Revision 1.99 1997-04-30 07:24:47 adam + * 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 @@ -3427,7 +3430,7 @@ static int ir_scan_obj_mk (ClientData clientData, Tcl_Interp *interp, /* ------------------------------------------------------- */ /* - * ir_log_proc: set yaz log level + * ir_log_init_proc: set yaz log level */ static int ir_log_init_proc (ClientData clientData, Tcl_Interp *interp, int argc, char **argv) @@ -3447,6 +3450,25 @@ static int ir_log_init_proc (ClientData clientData, Tcl_Interp *interp, return TCL_OK; } +/* + * ir_log_proc: log yaz message + */ +static int ir_log_proc (ClientData clientData, Tcl_Interp *interp, + int argc, char **argv) +{ + int mask; + if (argc != 3) + { + Tcl_AppendResult (interp, wrongArgs, *argv, + " level string\"", NULL); + return TCL_OK; + } + mask = log_mask_str_x (argv[1], 0); + logf (mask, "%s", argv[1], mask, argv[2]); + return TCL_OK; +} + + /* ------------------------------------------------------- */ static void ir_initResponse (void *obj, Z_InitResponse *initrs) { @@ -4109,6 +4131,8 @@ EXPORT (int,Irtcl_Init) (Tcl_Interp *interp) (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); Tcl_CreateCommand (interp, "ir-log-init", ir_log_init_proc, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); + Tcl_CreateCommand (interp, "ir-log", ir_log_proc, + (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); return TCL_OK; }