summaryrefslogtreecommitdiff
path: root/bin/ksh/emacs.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-12-22 17:14:35 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-12-22 17:14:35 +0000
commit876705771ce25a4fde66ddfeeaed78e36c2522fa (patch)
tree5302300c6a77585e42ee9c9473fe0405e5eb5896 /bin/ksh/emacs.c
parentd8ab4b6082e45f27eab20a66b1077ed25bcc3a30 (diff)
Use stdbool.h instead of rolling our own bools.
Diffstat (limited to 'bin/ksh/emacs.c')
-rw-r--r--bin/ksh/emacs.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/bin/ksh/emacs.c b/bin/ksh/emacs.c
index 27a0ea623c6..8ae612417c6 100644
--- a/bin/ksh/emacs.c
+++ b/bin/ksh/emacs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: emacs.c,v 1.32 2004/12/20 11:34:26 otto Exp $ */
+/* $OpenBSD: emacs.c,v 1.33 2004/12/22 17:14:34 millert Exp $ */
/*
* Emacs-like command line editing and history
@@ -317,7 +317,7 @@ x_emacs(char *buf, size_t len)
xbp = xbuf = buf; xend = buf + len;
xlp = xcp = xep = buf;
*xcp = 0;
- xlp_valid = TRUE;
+ xlp_valid = true;
xmp = NULL;
x_curprefix = 0;
macroptr = (char *) 0;
@@ -371,7 +371,7 @@ x_emacs(char *buf, size_t len)
return i;
case KINTR: /* special case for interrupt */
trapsig(SIGINT);
- x_mode(FALSE);
+ x_mode(false);
unwind(LSHELL);
}
}
@@ -440,7 +440,7 @@ x_ins(char *s)
* x_zots() may result in a call to x_adjust()
* we want xcp to reflect the new position.
*/
- xlp_valid = FALSE;
+ xlp_valid = false;
x_lastcp();
x_adj_ok = (xcp >= xlp);
x_zots(cp);
@@ -480,7 +480,7 @@ x_del_back(int c)
if (x_arg > col)
x_arg = col;
x_goto(xcp - x_arg);
- x_delete(x_arg, FALSE);
+ x_delete(x_arg, false);
return KSTD;
}
@@ -495,7 +495,7 @@ x_del_char(int c)
}
if (x_arg > nleft)
x_arg = nleft;
- x_delete(x_arg, FALSE);
+ x_delete(x_arg, false);
return KSTD;
}
@@ -548,7 +548,7 @@ x_delete(int nc, int push)
}
/*x_goto(xcp);*/
x_adj_ok = 1;
- xlp_valid = FALSE;
+ xlp_valid = false;
for (cp = x_lastcp(); cp > xcp; )
x_bs(*--cp);
@@ -558,7 +558,7 @@ x_delete(int nc, int push)
static int
x_del_bword(int c)
{
- x_delete(x_bword(), TRUE);
+ x_delete(x_bword(), true);
return KSTD;
}
@@ -579,7 +579,7 @@ x_mv_fword(int c)
static int
x_del_fword(int c)
{
- x_delete(x_fword(), TRUE);
+ x_delete(x_fword(), true);
return KSTD;
}
@@ -837,7 +837,7 @@ x_load_hist(char **hp)
strlcpy(xbuf, *hp, xend - xbuf);
xbp = xbuf;
xep = xcp = xbuf + strlen(xbuf);
- xlp_valid = FALSE;
+ xlp_valid = false;
if (xep > x_lastcp())
x_goto(xep);
else
@@ -967,7 +967,7 @@ x_del_line(int c)
xcp = xbuf;
x_push(i);
xlp = xbp = xep = xbuf;
- xlp_valid = TRUE;
+ xlp_valid = true;
*xcp = 0;
xmp = NULL;
x_redraw(j);
@@ -1018,7 +1018,7 @@ x_redraw(int limit)
x_col = promptlen(prompt, (const char **) 0);
}
x_displen = xx_cols - 2 - x_col;
- xlp_valid = FALSE;
+ xlp_valid = false;
cp = x_lastcp();
x_zots(xbp);
if (xbp != xbuf || xep > xlp)
@@ -1144,7 +1144,7 @@ x_kill(int c)
x_goto(xbuf + x_arg);
ndel = -ndel;
}
- x_delete(ndel, TRUE);
+ x_delete(ndel, true);
return KSTD;
}
@@ -1189,7 +1189,7 @@ x_meta_yank(int c)
}
len = strlen(killstack[killtp]);
x_goto(xcp - len);
- x_delete(len, FALSE);
+ x_delete(len, false);
do {
if (killtp == 0)
killtp = KILLSIZE - 1;
@@ -1205,7 +1205,7 @@ x_abort(int c)
{
/* x_zotc(c); */
xlp = xep = xcp = xbp = xbuf;
- xlp_valid = TRUE;
+ xlp_valid = true;
*xcp = 0;
return KINTR;
}
@@ -1226,7 +1226,7 @@ x_stuffreset(int c)
#else
x_zotc(c);
xlp = xcp = xep = xbp = xbuf;
- xlp_valid = TRUE;
+ xlp_valid = true;
*xcp = 0;
x_redraw(-1);
return KSTD;
@@ -1238,7 +1238,7 @@ x_stuff(int c)
{
#ifdef TIOCSTI
char ch = c;
- bool_t savmode = x_mode(FALSE);
+ bool savmode = x_mode(false);
(void)ioctl(TTY, TIOCSTI, &ch);
(void)x_mode(savmode);
@@ -1481,7 +1481,7 @@ x_kill_region(int c)
xr = xmp;
}
x_goto(xr);
- x_delete(rsize, TRUE);
+ x_delete(rsize, true);
xmp = xr;
return KSTD;
}
@@ -1654,7 +1654,7 @@ x_expand(int c)
}
x_goto(xbuf + start);
- x_delete(end - start, FALSE);
+ x_delete(end - start, false);
for (i = 0; i < nwords;) {
if (x_escape(words[i], strlen(words[i]), x_emacs_putbuf) < 0 ||
(++i < nwords && x_ins(space) < 0))
@@ -1699,7 +1699,7 @@ do_complete(int flags, /* XCF_{COMMAND,FILE,COMMAND_FILE} */
/* complete */
if (nwords == 1 || nlen > olen) {
x_goto(xbuf + start);
- x_delete(olen, FALSE);
+ x_delete(olen, false);
x_escape(words[0], nlen, x_emacs_putbuf);
x_adjust();
completed = 1;
@@ -1744,7 +1744,7 @@ x_adjust(void)
*/
if ((xbp = xcp - (x_displen / 2)) < xbuf)
xbp = xbuf;
- xlp_valid = FALSE;
+ xlp_valid = false;
x_redraw(xx_cols);
x_flush();
}
@@ -2059,7 +2059,7 @@ x_lastcp(void)
i += x_size(*rcp);
xlp = rcp;
}
- xlp_valid = TRUE;
+ xlp_valid = true;
return (xlp);
}