I like timestamps. /oset timestamp shows something like [=Time=] Sat Jun 24 01:26:52 PKT 2000 at least every . /oset timestamp_msg true shows message timestamps. Not the world's best code: Index: icb/globals.c =================================================================== RCS file: /tmp/cvs/cicb/icb/globals.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 globals.c --- icb/globals.c 2000/04/22 20:07:58 1.1.1.1 +++ icb/globals.c 2000/06/23 19:20:14 @@ -64,7 +64,11 @@ "", /* personalto */ 0, /* logreplay */ "none", /* alert */ - 0 /* autoregister */ + 0, /* autoregister */ + 0, /* timestamp */ + 0 /* timestamp_msg */ }; int echomode = 1; /* is echo on or off? */ + +time_t time_last_stamped; Index: icb/icb.h =================================================================== RCS file: /tmp/cvs/cicb/icb/icb.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 icb.h --- icb/icb.h 2000/04/22 20:07:58 1.1.1.1 +++ icb/icb.h 2000/06/23 19:11:24 @@ -47,6 +47,8 @@ char *alert; /* alert mode */ int autoregister; /* prompt for password when [=Register=] msg received? */ + int timestamp; /* timestamp every so often (0 = never) */ + int timestamp_msg; /* timestamp messages */ } GLOBS; /* info on the user's tty */ Index: icb/oset.c =================================================================== RCS file: /tmp/cvs/cicb/icb/oset.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 oset.c --- icb/oset.c 2000/04/22 20:07:59 1.1.1.1 +++ icb/oset.c 2000/06/23 19:13:32 @@ -42,6 +42,8 @@ { "restricted", V_BOOLEAN, (char *)&gv.restricted }, { "tabreply", V_BOOLEAN, (char *)&gv.tabreply }, { "timedisplay", V_STRING, (char *)&gv.timedisplay }, + { "timestamp", V_NONNEG, (char *)&gv.timestamp }, + { "timestamp_msg", V_BOOLEAN, (char *)&gv.timestamp_msg }, { "verifyquit", V_BOOLEAN, (char *)&gv.verifyquit }, { NULL, 0, NULL } }; Index: icb/print.c =================================================================== RCS file: /tmp/cvs/cicb/icb/print.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 print.c --- icb/print.c 2000/04/22 20:07:59 1.1.1.1 +++ icb/print.c 2000/06/23 20:20:21 @@ -5,6 +5,8 @@ #include "icb.h" #include "externs.h" +#include +#include extern FILE *logfp; @@ -17,21 +19,37 @@ char printbuf[1024]; char *p = printbuf; char *t = s; + char *time_str = NULL; + char print_time[34]; + time_t cur_time; + extern time_t time_last_stamped; if (continued) { linenumber = 0; continued = 0; } + if (gv.timestamp > 0) { + cur_time = time(NULL); + if (cur_time > (time_last_stamped + gv.timestamp)) { + time_last_stamped = cur_time; + time_str = ctime(&cur_time); + time_str[strlen(time_str)] = '\0'; + sprintf(print_time, "%s[=%sTime%s=]%s %s",cequalbracket,cstatus,cequalbracket,csane,time_str); + } + } + if (flags & PL_SCR) { /* if paging in effect, do paging */ if (gv.pagesize && (++linenumber >= gv.pagesize)) { sprintf(cgenbuff,"%s[=%sMore%s=]%s",cequalbracket,cmore,cequalbracket,csane); - pauseprompt(cgenbuff, 1, 0, 1, (int) " "); + pauseprompt(cgenbuff, 0, 0, 1, (int) " "); linenumber = 0; } /* write to the screen */ + if (time_str) + write(1, print_time, strlen(print_time)); while (*t != '\0') *p++ = *t++; *p++ = '\r'; @@ -41,6 +59,10 @@ /* put line into session log */ if ((flags & PL_LOG) && logfp != NULL) { + if (time_str) { + fputs(print_time, logfp); + putc('\n', logfp); + } fputs(s, logfp); putc('\n', logfp); } Index: icb/strings.c =================================================================== RCS file: /tmp/cvs/cicb/icb/strings.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 strings.c --- icb/strings.c 2000/04/22 20:08:02 1.1.1.1 +++ icb/strings.c 2000/06/23 19:55:28 @@ -4,6 +4,8 @@ #include "icb.h" #include "externs.h" #include +#include +#include extern char *charmap; @@ -260,10 +262,28 @@ int per; char *from, *s; { - if (per) - sprintf(mbuf, "%s<*%s*>%s %s%s",cpersfrom,from,cwhisper,s,csane); - else - sprintf(mbuf, "%s<%s%s%s>%s %s%s",cgtlt,cusername,from,cgtlt,cnormal,s,csane); + time_t cur_time; + char *time_str; + char show_time[6]; + + if (gv.timestamp_msg) { + cur_time = time(NULL); + time_str = ctime(&cur_time); + strncpy((char *) &show_time[0], (char *) &time_str[11], 5); + show_time[5] = '\0'; + } + + if (per) { + if (gv.timestamp_msg) + sprintf(mbuf, "%s<*%s[%s]*>%s %s%s",cpersfrom,from,show_time,cwhisper,s,csane); + else + sprintf(mbuf, "%s<*%s*>%s %s%s",cpersfrom,from,cwhisper,s,csane); + } else { + if (gv.timestamp_msg) + sprintf(mbuf, "%s<%s%s[%s]%s>%s %s%s",cgtlt,cusername,from,show_time,cgtlt,cnormal,s,csane); + else + sprintf(mbuf, "%s<%s%s%s>%s %s%s",cgtlt,cusername,from,cgtlt,cnormal,s,csane); + } putl(mbuf, PL_ALL); }