4 * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
9 static char rcsid[] = "$Id$";
13 * Revision 1.1 2008/02/08 15:06:42 james
14 * *** empty log message ***
20 History *history_new(int n)
24 ret=(History *) malloc(sizeof(History));
25 ret->lines=malloc(n*sizeof(History_ent));
26 memset(ret->lines,0,n*sizeof(History_ent));
34 void history_free(History *h)
37 if (h->lines) free(h->lines);
42 void history_add(History *h,CRT_CA *c)
46 memcpy(h->lines[h->wptr].line,c,sizeof(CRT_CA)*CRT_COLS);
49 if (h->wptr==h->nlines)