repo.or.cz
/
neatvi.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
led: ^C should act like escape in input mode
[neatvi.git]
/
reg.c
blob
7929ba5c68d5cd2626d7d64e51b9222bf79f2f06
1
#include <stdlib.h>
2
#include <string.h>
3
#include
"vi.h"
4
5
static char
*
bufs
[
256
];
6
static int
lnmode
[
256
];
7
8
char
*
reg_get
(
int
c
,
int
*
ln
)
9
{
10
*
ln
=
lnmode
[
c
];
11
return
bufs
[
c
];
12
}
13
14
void
reg_put
(
int
c
,
char
*
s
,
int
ln
)
15
{
16
char
*
buf
=
malloc
(
strlen
(
s
) +
1
);
17
strcpy
(
buf
,
s
);
18
free
(
bufs
[
c
]);
19
bufs
[
c
] =
buf
;
20
lnmode
[
c
] =
ln
;
21
}
22
23
void
reg_done
(
void
)
24
{
25
int
i
;
26
for
(
i
=
0
;
i
<
LEN
(
bufs
);
i
++)
27
free
(
bufs
[
i
]);
28
}