led: ^C should act like escape in input mode
[neatvi.git] / reg.c
blob7929ba5c68d5cd2626d7d64e51b9222bf79f2f06
1 #include <stdlib.h>
2 #include <string.h>
3 #include "vi.h"
5 static char *bufs[256];
6 static int lnmode[256];
8 char *reg_get(int c, int *ln)
10 *ln = lnmode[c];
11 return bufs[c];
14 void reg_put(int c, char *s, int ln)
16 char *buf = malloc(strlen(s) + 1);
17 strcpy(buf, s);
18 free(bufs[c]);
19 bufs[c] = buf;
20 lnmode[c] = ln;
23 void reg_done(void)
25 int i;
26 for (i = 0; i < LEN(bufs); i++)
27 free(bufs[i]);