version 1.49, 2009/06/04 23:39:37 |
version 1.50, 2012/04/12 04:47:59 |
|
|
|
|
#include "def.h" |
#include "def.h" |
#include "key.h" |
#include "key.h" |
#ifndef NO_MACRO |
|
#include "macro.h" |
#include "macro.h" |
#endif /* !NO_MACRO */ |
|
|
|
#include "funmap.h" |
#include "funmap.h" |
|
|
|
|
{ |
{ |
int s; |
int s; |
|
|
#ifndef NO_MACRO |
|
if (inmacro) |
if (inmacro) |
return (TRUE); |
return (TRUE); |
#endif /* !NO_MACRO */ |
|
ewprintf("%s? (y or n) ", sp); |
ewprintf("%s? (y or n) ", sp); |
for (;;) { |
for (;;) { |
s = getkey(FALSE); |
s = getkey(FALSE); |
|
|
{ |
{ |
char buf[64], *rep; |
char buf[64], *rep; |
|
|
#ifndef NO_MACRO |
|
if (inmacro) |
if (inmacro) |
return (TRUE); |
return (TRUE); |
#endif /* !NO_MACRO */ |
|
rep = eread("%s? (yes or no) ", buf, sizeof(buf), |
rep = eread("%s? (yes or no) ", buf, sizeof(buf), |
EFNUL | EFNEW | EFCR, sp); |
EFNUL | EFNEW | EFCR, sp); |
for (;;) { |
for (;;) { |
if (rep == NULL) |
if (rep == NULL) |
return (ABORT); |
return (ABORT); |
if (rep[0] != '\0') { |
if (rep[0] != '\0') { |
#ifndef NO_MACRO |
|
if (macrodef) { |
if (macrodef) { |
struct line *lp = maclcur; |
struct line *lp = maclcur; |
|
|
|
|
maclcur->l_fp = lp->l_fp; |
maclcur->l_fp = lp->l_fp; |
free(lp); |
free(lp); |
} |
} |
#endif /* !NO_MACRO */ |
|
if ((rep[0] == 'y' || rep[0] == 'Y') && |
if ((rep[0] == 'y' || rep[0] == 'Y') && |
(rep[1] == 'e' || rep[1] == 'E') && |
(rep[1] == 'e' || rep[1] == 'E') && |
(rep[2] == 's' || rep[2] == 'S') && |
(rep[2] == 's' || rep[2] == 'S') && |
|
|
|
|
static char emptyval[] = ""; /* XXX hackish way to return err msg*/ |
static char emptyval[] = ""; /* XXX hackish way to return err msg*/ |
|
|
#ifndef NO_MACRO |
|
if (inmacro) { |
if (inmacro) { |
if (dynbuf) { |
if (dynbuf) { |
if ((buf = malloc(maclcur->l_used + 1)) == NULL) |
if ((buf = malloc(maclcur->l_used + 1)) == NULL) |
|
|
maclcur = maclcur->l_fp; |
maclcur = maclcur->l_fp; |
return (buf); |
return (buf); |
} |
} |
#endif /* !NO_MACRO */ |
|
epos = cpos = 0; |
epos = cpos = 0; |
ml = mr = esc = 0; |
ml = mr = esc = 0; |
cplflag = FALSE; |
cplflag = FALSE; |
|
|
ttputc(CCHR('M')); |
ttputc(CCHR('M')); |
ttflush(); |
ttflush(); |
} |
} |
#ifndef NO_MACRO |
|
if (macrodef) { |
if (macrodef) { |
struct line *lp; |
struct line *lp; |
|
|
|
|
maclcur = lp; |
maclcur = lp; |
bcopy(buf, lp->l_text, cpos); |
bcopy(buf, lp->l_text, cpos); |
} |
} |
#endif /* !NO_MACRO */ |
|
ret = buf; |
ret = buf; |
goto done; |
goto done; |
case CCHR('G'): /* bell, abort */ |
case CCHR('G'): /* bell, abort */ |
|
|
{ |
{ |
va_list ap; |
va_list ap; |
|
|
#ifndef NO_MACRO |
|
if (inmacro) |
if (inmacro) |
return; |
return; |
#endif /* !NO_MACRO */ |
|
va_start(ap, fmt); |
va_start(ap, fmt); |
ttcolor(CTEXT); |
ttcolor(CTEXT); |
ttmove(nrow - 1, 0); |
ttmove(nrow - 1, 0); |