/*
* $Log$
+ * Revision 1.3 2008/02/13 16:57:29 james
+ * *** empty log message ***
+ *
* Revision 1.2 2008/02/12 22:36:46 james
* *** empty log message ***
*
void
history_add (History * h, CRT_CA * c)
{
+ History_ent *e;
if (!h)
return;
- memcpy (h->lines[h->wptr].line, c, sizeof (CRT_CA) * CRT_COLS);
- h->wptr++;
+ e = &h->lines[h->wptr];
+ HISTORY_INC (h, h->wptr);
+
+ memcpy (e->line, c, sizeof (CRT_CA) * CRT_COLS);
+ time (&e->t);
+ e->valid = 1;
+
+#if 0
+ {
+ int i = CRT_COLS;
+ while (i--)
+ {
+ fputc (c->chr, stderr);
+ c++;
+ }
+ fputc ('\n', stderr);
+ }
+#endif
- if (h->wptr == h->nlines)
- h->wptr = 0;
}