6 static char *bufs
[256];
7 static int lnmode
[256];
9 char *reg_get(int c
, int *ln
)
15 static void reg_putraw(int c
, char *s
, int ln
)
17 char *pre
= isupper(c
) && bufs
[tolower(c
)] ? bufs
[tolower(c
)] : "";
18 char *buf
= malloc(strlen(pre
) + strlen(s
) + 1);
21 free(bufs
[tolower(c
)]);
22 bufs
[tolower(c
)] = buf
;
23 lnmode
[tolower(c
)] = ln
;
26 void reg_put(int c
, char *s
, int ln
)
30 if (ln
|| strchr(s
, '\n')) {
31 for (i
= 8; i
> 0; i
--)
32 if ((i_s
= reg_get('0' + i
, &i_ln
)))
33 reg_putraw('0' + i
+ 1, i_s
, i_ln
);
34 reg_putraw('1', s
, ln
);
42 for (i
= 0; i
< LEN(bufs
); i
++)