summaryrefslogtreecommitdiff
path: root/usr.bin/mg/echo.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/mg/echo.c')
-rw-r--r--usr.bin/mg/echo.c48
1 files changed, 15 insertions, 33 deletions
diff --git a/usr.bin/mg/echo.c b/usr.bin/mg/echo.c
index 21380e7babe..793b3603f20 100644
--- a/usr.bin/mg/echo.c
+++ b/usr.bin/mg/echo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: echo.c,v 1.20 2002/02/16 21:27:49 millert Exp $ */
+/* $OpenBSD: echo.c,v 1.21 2002/03/11 13:02:56 vincent Exp $ */
/*
* Echo line reading and writing.
@@ -23,7 +23,7 @@ static int complt_list(int, int, char *, int);
static void eformat(const char *, va_list);
static void eputi(int, int);
static void eputl(long, int);
-static void eputs(char *);
+static void eputs(const char *);
static void eputc(char);
static LIST *copy_list(LIST *);
@@ -33,7 +33,7 @@ int epresf = FALSE; /* stuff in echo line flag */
* Erase the echo line.
*/
void
-eerase()
+eerase(void)
{
ttcolor(CTEXT);
ttmove(nrow - 1, 0);
@@ -49,8 +49,7 @@ eerase()
* required.
*/
int
-eyorn(sp)
- char *sp;
+eyorn(const char *sp)
{
int s;
@@ -77,8 +76,7 @@ eyorn(sp)
* "yes" or "no" and the trainling newline.
*/
int
-eyesno(sp)
- char *sp;
+eyesno(const char *sp)
{
int s;
char buf[64];
@@ -307,9 +305,7 @@ done:
* do completion on a list of objects.
*/
static int
-complt(flags, c, buf, cpos)
- int flags, c, cpos;
- char *buf;
+complt(int flags, int c, char *buf, int cpos)
{
LIST *lh, *lh2;
LIST *wholelist = NULL;
@@ -403,11 +399,7 @@ complt(flags, c, buf, cpos)
* do completion on a list of objects, listing instead of completing
*/
static int
-complt_list(flags, c, buf, cpos)
- int flags;
- int c;
- char *buf;
- int cpos;
+complt_list(int flags, int c, char *buf, int cpos)
{
LIST *lh, *lh2, *lh3;
LIST *wholelist = NULL;
@@ -418,7 +410,7 @@ complt_list(flags, c, buf, cpos)
int oldcol = ttcol;
int oldhue = tthue;
char *linebuf;
- char *cp;
+ const char *cp;
lh = NULL;
@@ -562,10 +554,7 @@ complt_list(flags, c, buf, cpos)
* this is normal.
*/
int
-getxtra(lp1, lp2, cpos, wflag)
- LIST *lp1, *lp2;
- int cpos;
- int wflag;
+getxtra(LIST *lp1, LIST *lp2, int cpos, int wflag)
{
int i;
@@ -679,8 +668,7 @@ eformat(const char *fp, va_list ap)
* Put integer, in radix "r".
*/
static void
-eputi(i, r)
- int i, r;
+eputi(int i, int r)
{
int q;
@@ -697,9 +685,7 @@ eputi(i, r)
* Put long, in radix "r".
*/
static void
-eputl(l, r)
- long l;
- int r;
+eputl(long l, int r)
{
long q;
@@ -716,8 +702,7 @@ eputl(l, r)
* Put string.
*/
static void
-eputs(s)
- char *s;
+eputs(const char *s)
{
int c;
@@ -730,8 +715,7 @@ eputs(s)
* too long.
*/
static void
-eputc(c)
- char c;
+eputc(char c)
{
if (ttcol + 2 < ncol) {
if (ISCTRL(c)) {
@@ -744,8 +728,7 @@ eputc(c)
}
void
-free_file_list(lp)
- LIST *lp;
+free_file_list(LIST *lp)
{
LIST *next;
@@ -757,8 +740,7 @@ free_file_list(lp)
}
static LIST *
-copy_list(lp)
- LIST *lp;
+copy_list(LIST *lp)
{
LIST *current, *last;