add a feature which allows icb to print the current time in front of every

line by setting the option printtime to true.

From: NetBSD
This commit is contained in:
brad 2000-01-16 11:29:54 +00:00
parent e0e3ed5099
commit 47d4e04482
6 changed files with 96 additions and 0 deletions

10
net/icb/patches/patch-ap Normal file
View File

@ -0,0 +1,10 @@
--- icb/globals.c.orig Sun Jan 16 05:13:12 2000
+++ icb/globals.c Sun Jan 16 05:13:51 2000
@@ -59,6 +59,7 @@
1, /* beeps */
"vi", /* editmode */
0, /* tabreply */
+ 0, /* printtime */
1, /* cute */
0, /* autodel */
"", /* personalto */

14
net/icb/patches/patch-aq Normal file
View File

@ -0,0 +1,14 @@
--- icb/helpdata.c.orig Sun Jan 16 05:17:17 2000
+++ icb/helpdata.c Sun Jan 16 05:20:39 2000
@@ -600,6 +600,11 @@
" waiting for your screen, this gives you a chance to see the output",
" of your command.",
"",
+"printtime (boolean) default: false",
+"",
+" Print the current time in front of every line sent to the display",
+" and log file.",
+"",
"restricted (boolean) default: false",
"",
" Restricted shuts off the ability to run subshell commands or to",

10
net/icb/patches/patch-ar Normal file
View File

@ -0,0 +1,10 @@
--- icb/icb.h.orig Sun Jan 16 05:21:47 2000
+++ icb/icb.h Sun Jan 16 05:22:47 2000
@@ -38,6 +38,7 @@
int beeps; /* whether beeps are audible */
char *editmode; /* input editing mode */
int tabreply; /* should replies go into the tab history? */
+ int printtime; /* print timestamp in front of every msg? */
int cute; /* cute messages when a blank line is entered */
int autodel; /* automatically delete nicks from the tab
history that produce a "not logged on" error */

10
net/icb/patches/patch-as Normal file
View File

@ -0,0 +1,10 @@
--- icb/oset.c.orig Sun Jan 16 05:24:09 2000
+++ icb/oset.c Sun Jan 16 05:25:55 2000
@@ -39,6 +39,7 @@
{ "pagesize", V_INT, (char *)&gv.pagesize },
{ "pauseonshell", V_BOOLEAN, (char *)&gv.pauseonshell },
{ "personalto", V_STRING, (char *)&gv.personalto },
+ { "printtime", V_BOOLEAN, (char *)&gv.printtime },
{ "restricted", V_BOOLEAN, (char *)&gv.restricted },
{ "tabreply", V_BOOLEAN, (char *)&gv.tabreply },
{ "timedisplay", V_STRING, (char *)&gv.timedisplay },

42
net/icb/patches/patch-at Normal file
View File

@ -0,0 +1,42 @@
--- icb/print.c.orig Sun Jan 16 05:27:01 2000
+++ icb/print.c Sun Jan 16 05:32:24 2000
@@ -5,6 +5,7 @@
#include "icb.h"
#include "externs.h"
+#include <time.h>
extern FILE *logfp;
@@ -17,12 +18,22 @@
char printbuf[1024];
char *p = printbuf;
char *t = s;
+ struct tm *tm, *localtime();
+ char timestamp[9];
if (continued) {
linenumber = 0;
continued = 0;
}
+ /* If requested, prepare timestamp */
+ if (gv.printtime) {
+ gettime();
+ tm = localtime(&curtime);
+ snprintf(timestamp, sizeof(timestamp), "[%02d:%02d] ",
+ tm->tm_hour, tm->tm_min);
+ }
+
if (flags & PL_SCR) {
/* if paging in effect, do paging */
if (gv.pagesize && (++linenumber >= gv.pagesize)) {
@@ -35,6 +46,8 @@
*p++ = *t++;
*p++ = '\r';
*p++ = '\n';
+ if (gv.printtime)
+ write(1, timestamp, 8);
write(1, printbuf, p - printbuf);
}

10
net/icb/patches/patch-au Normal file
View File

@ -0,0 +1,10 @@
--- sample.icbrc.orig Sun Jan 16 05:42:58 2000
+++ sample.icbrc Sun Jan 16 05:46:28 2000
@@ -15,6 +15,7 @@
oset autodel false # set to "true" to have nicks that generate an "error -
# so-and-so not signed on" removed from tab history
#echoback on # uncomment to see your own public messages
+#oset printtime true # print time in front of every message
#==============================================================================#
# procedures