diff options
Diffstat (limited to 'usr.bin/vi/cl')
-rw-r--r-- | usr.bin/vi/cl/cl_funcs.c | 59 | ||||
-rw-r--r-- | usr.bin/vi/cl/cl_main.c | 41 | ||||
-rw-r--r-- | usr.bin/vi/cl/cl_read.c | 21 | ||||
-rw-r--r-- | usr.bin/vi/cl/cl_screen.c | 33 | ||||
-rw-r--r-- | usr.bin/vi/cl/cl_term.c | 42 |
5 files changed, 54 insertions, 142 deletions
diff --git a/usr.bin/vi/cl/cl_funcs.c b/usr.bin/vi/cl/cl_funcs.c index 04a6fcfa233..01ccc324427 100644 --- a/usr.bin/vi/cl/cl_funcs.c +++ b/usr.bin/vi/cl/cl_funcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl_funcs.c,v 1.15 2014/11/06 10:48:52 bentley Exp $ */ +/* $OpenBSD: cl_funcs.c,v 1.16 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -37,10 +37,7 @@ * PUBLIC: int cl_addstr(SCR *, const char *, size_t); */ int -cl_addstr(sp, str, len) - SCR *sp; - const char *str; - size_t len; +cl_addstr(SCR *sp, const char *str, size_t len) { size_t oldy, oldx; int iv; @@ -72,10 +69,7 @@ cl_addstr(sp, str, len) * PUBLIC: int cl_attr(SCR *, scr_attr_t, int); */ int -cl_attr(sp, attribute, on) - SCR *sp; - scr_attr_t attribute; - int on; +cl_attr(SCR *sp, scr_attr_t attribute, int on) { CL_PRIVATE *clp; @@ -160,9 +154,7 @@ cl_attr(sp, attribute, on) * PUBLIC: int cl_baud(SCR *, u_long *); */ int -cl_baud(sp, ratep) - SCR *sp; - u_long *ratep; +cl_baud(SCR *sp, u_long *ratep) { CL_PRIVATE *clp; @@ -203,8 +195,7 @@ cl_baud(sp, ratep) * PUBLIC: int cl_bell(SCR *); */ int -cl_bell(sp) - SCR *sp; +cl_bell(SCR *sp) { if (F_ISSET(sp, SC_EX | SC_SCR_EXWROTE)) (void)write(STDOUT_FILENO, "\07", 1); /* \a */ @@ -235,8 +226,7 @@ cl_bell(sp) * PUBLIC: int cl_clrtoeol(SCR *); */ int -cl_clrtoeol(sp) - SCR *sp; +cl_clrtoeol(SCR *sp) { return (clrtoeol() == ERR); } @@ -248,9 +238,7 @@ cl_clrtoeol(sp) * PUBLIC: int cl_cursor(SCR *, size_t *, size_t *); */ int -cl_cursor(sp, yp, xp) - SCR *sp; - size_t *yp, *xp; +cl_cursor(SCR *sp, size_t *yp, size_t *xp) { /* * The curses screen support splits a single underlying curses screen @@ -271,8 +259,7 @@ cl_cursor(sp, yp, xp) * PUBLIC: int cl_deleteln(SCR *); */ int -cl_deleteln(sp) - SCR *sp; +cl_deleteln(SCR *sp) { #ifndef mvchgat CHAR_T ch; @@ -336,9 +323,7 @@ cl_deleteln(sp) * PUBLIC: int cl_ex_adjust(SCR *, exadj_t); */ int -cl_ex_adjust(sp, action) - SCR *sp; - exadj_t action; +cl_ex_adjust(SCR *sp, exadj_t action) { CL_PRIVATE *clp; int cnt; @@ -393,8 +378,7 @@ cl_ex_adjust(sp, action) * PUBLIC: int cl_insertln(SCR *); */ int -cl_insertln(sp) - SCR *sp; +cl_insertln(SCR *sp) { /* * The current line is expected to be blank after this operation, @@ -410,11 +394,7 @@ cl_insertln(sp) * PUBLIC: int cl_keyval(SCR *, scr_keyval_t, CHAR_T *, int *); */ int -cl_keyval(sp, val, chp, dnep) - SCR *sp; - scr_keyval_t val; - CHAR_T *chp; - int *dnep; +cl_keyval(SCR *sp, scr_keyval_t val, CHAR_T *chp, int *dnep) { CL_PRIVATE *clp; @@ -452,9 +432,7 @@ cl_keyval(sp, val, chp, dnep) * PUBLIC: int cl_move(SCR *, size_t, size_t); */ int -cl_move(sp, lno, cno) - SCR *sp; - size_t lno, cno; +cl_move(SCR *sp, size_t lno, size_t cno) { /* See the comment in cl_cursor. */ if (move(RLNO(sp, lno), cno) == ERR) { @@ -472,9 +450,7 @@ cl_move(sp, lno, cno) * PUBLIC: int cl_refresh(SCR *, int); */ int -cl_refresh(sp, repaint) - SCR *sp; - int repaint; +cl_refresh(SCR *sp, int repaint) { CL_PRIVATE *clp; @@ -507,10 +483,7 @@ cl_refresh(sp, repaint) * PUBLIC: int cl_rename(SCR *, char *, int); */ int -cl_rename(sp, name, on) - SCR *sp; - char *name; - int on; +cl_rename(SCR *sp, char *name, int on) { GS *gp; CL_PRIVATE *clp; @@ -548,9 +521,7 @@ cl_rename(sp, name, on) * PUBLIC: int cl_suspend(SCR *, int *); */ int -cl_suspend(sp, allowedp) - SCR *sp; - int *allowedp; +cl_suspend(SCR *sp, int *allowedp) { struct termios t; CL_PRIVATE *clp; diff --git a/usr.bin/vi/cl/cl_main.c b/usr.bin/vi/cl/cl_main.c index f9737f9c32b..1a404cbf7df 100644 --- a/usr.bin/vi/cl/cl_main.c +++ b/usr.bin/vi/cl/cl_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl_main.c,v 1.21 2014/11/10 21:34:13 tedu Exp $ */ +/* $OpenBSD: cl_main.c,v 1.22 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -141,8 +141,7 @@ main(int argc, char *argv[]) * Create and partially initialize the GS structure. */ static GS * -gs_init(name) - char *name; +gs_init(char *name) { GS *gp; char *p; @@ -166,8 +165,7 @@ gs_init(name) * Create and partially initialize the CL structure. */ static CL_PRIVATE * -cl_init(gp) - GS *gp; +cl_init(GS *gp) { CL_PRIVATE *clp; int fd; @@ -215,8 +213,7 @@ tcfail: perr(gp->progname, "tcgetattr"); * Initialize terminal information. */ static void -term_init(name, ttype) - char *name, *ttype; +term_init(char *name, char *ttype) { int err; @@ -237,8 +234,7 @@ term_init(name, ttype) #define GLOBAL_CLP \ CL_PRIVATE *clp = GCLP(__global_list); static void -h_hup(signo) - int signo; +h_hup(int signo) { GLOBAL_CLP; @@ -247,8 +243,7 @@ h_hup(signo) } static void -h_int(signo) - int signo; +h_int(int signo) { GLOBAL_CLP; @@ -256,8 +251,7 @@ h_int(signo) } static void -h_term(signo) - int signo; +h_term(int signo) { GLOBAL_CLP; @@ -266,8 +260,7 @@ h_term(signo) } static void -h_winch(signo) - int signo; +h_winch(int signo) { GLOBAL_CLP; @@ -282,9 +275,7 @@ h_winch(signo) * PUBLIC: int sig_init(GS *, SCR *); */ int -sig_init(gp, sp) - GS *gp; - SCR *sp; +sig_init(GS *gp, SCR *sp) { CL_PRIVATE *clp; @@ -326,10 +317,7 @@ sig_init(gp, sp) * Set a signal handler. */ static int -setsig(signo, oactp, handler) - int signo; - struct sigaction *oactp; - void (*handler)(int); +setsig(int signo, struct sigaction *oactp, void (*handler)(int)) { struct sigaction act; @@ -360,8 +348,7 @@ setsig(signo, oactp, handler) * End signal setup. */ static void -sig_end(gp) - GS *gp; +sig_end(GS *gp) { CL_PRIVATE *clp; @@ -379,8 +366,7 @@ sig_end(gp) * Initialize the standard curses functions. */ static void -cl_func_std(gp) - GS *gp; +cl_func_std(GS *gp) { gp->scr_addstr = cl_addstr; gp->scr_attr = cl_attr; @@ -410,8 +396,7 @@ cl_func_std(gp) * Print system error. */ static void -perr(name, msg) - char *name, *msg; +perr(char *name, char *msg) { (void)fprintf(stderr, "%s:", name); if (msg != NULL) diff --git a/usr.bin/vi/cl/cl_read.c b/usr.bin/vi/cl/cl_read.c index dfd27de60d0..a2c1cadb2ef 100644 --- a/usr.bin/vi/cl/cl_read.c +++ b/usr.bin/vi/cl/cl_read.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl_read.c,v 1.18 2009/10/27 23:59:47 deraadt Exp $ */ +/* $OpenBSD: cl_read.c,v 1.19 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -42,11 +42,7 @@ static int cl_resize(SCR *, size_t, size_t); * PUBLIC: int cl_event(SCR *, EVENT *, u_int32_t, int); */ int -cl_event(sp, evp, flags, ms) - SCR *sp; - EVENT *evp; - u_int32_t flags; - int ms; +cl_event(SCR *sp, EVENT *evp, u_int32_t flags, int ms) { struct timeval t, *tp; CL_PRIVATE *clp; @@ -127,13 +123,8 @@ retest: if (LF_ISSET(EC_INTERRUPT) || F_ISSET(clp, CL_SIGINT)) { * Read characters from the input. */ static input_t -cl_read(sp, flags, bp, blen, nrp, tp) - SCR *sp; - u_int32_t flags; - CHAR_T *bp; - size_t blen; - int *nrp; - struct timeval *tp; +cl_read(SCR *sp, u_int32_t flags, CHAR_T *bp, size_t blen, int *nrp, + struct timeval *tp) { struct termios term1, term2; CL_PRIVATE *clp; @@ -283,9 +274,7 @@ err: if (errno == EINTR) * Reset the options for a resize event. */ static int -cl_resize(sp, lines, columns) - SCR *sp; - size_t lines, columns; +cl_resize(SCR *sp, size_t lines, size_t columns) { ARGS *argv[2], a, b; char b1[1024]; diff --git a/usr.bin/vi/cl/cl_screen.c b/usr.bin/vi/cl/cl_screen.c index 4fc553cdb56..59d7f4c0c08 100644 --- a/usr.bin/vi/cl/cl_screen.c +++ b/usr.bin/vi/cl/cl_screen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl_screen.c,v 1.20 2013/11/28 22:12:40 krw Exp $ */ +/* $OpenBSD: cl_screen.c,v 1.21 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -42,9 +42,7 @@ static int cl_putenv(char *, char *, u_long); * PUBLIC: int cl_screen(SCR *, u_int32_t); */ int -cl_screen(sp, flags) - SCR *sp; - u_int32_t flags; +cl_screen(SCR *sp, u_int32_t flags) { CL_PRIVATE *clp; GS *gp; @@ -126,8 +124,7 @@ cl_screen(sp, flags) * PUBLIC: int cl_quit(GS *); */ int -cl_quit(gp) - GS *gp; +cl_quit(GS *gp) { CL_PRIVATE *clp; int rval; @@ -177,8 +174,7 @@ cl_quit(gp) * Initialize the curses vi screen. */ static int -cl_vi_init(sp) - SCR *sp; +cl_vi_init(SCR *sp) { CL_PRIVATE *clp; char *o_cols, *o_lines, *o_term, *ttype; @@ -379,8 +375,7 @@ err: (void)cl_vi_end(sp->gp); * Shutdown the vi screen. */ static int -cl_vi_end(gp) - GS *gp; +cl_vi_end(GS *gp) { CL_PRIVATE *clp; @@ -423,8 +418,7 @@ cl_vi_end(gp) * Initialize the ex screen. */ static int -cl_ex_init(sp) - SCR *sp; +cl_ex_init(SCR *sp) { CL_PRIVATE *clp; @@ -498,8 +492,7 @@ fast: if (tcsetattr(STDIN_FILENO, TCSADRAIN | TCSASOFT, &clp->ex_enter)) { * Shutdown the ex screen. */ static int -cl_ex_end(gp) - GS *gp; +cl_ex_end(GS *gp) { CL_PRIVATE *clp; @@ -517,9 +510,7 @@ cl_ex_end(gp) * PUBLIC: int cl_getcap(SCR *, char *, char **); */ int -cl_getcap(sp, name, elementp) - SCR *sp; - char *name, **elementp; +cl_getcap(SCR *sp, char *name, char **elementp) { size_t len; char *t; @@ -537,8 +528,7 @@ cl_getcap(sp, name, elementp) * Free any allocated termcap/terminfo strings. */ static void -cl_freecap(clp) - CL_PRIVATE *clp; +cl_freecap(CL_PRIVATE *clp) { if (clp->el != NULL) { free(clp->el); @@ -567,10 +557,7 @@ cl_freecap(clp) * Put a value into the environment. */ static int -cl_putenv(name, str, value) - char *name, *str; - u_long value; - +cl_putenv(char *name, char *str, u_long value) { char buf[40]; diff --git a/usr.bin/vi/cl/cl_term.c b/usr.bin/vi/cl/cl_term.c index db64b6b68da..40c46368bd4 100644 --- a/usr.bin/vi/cl/cl_term.c +++ b/usr.bin/vi/cl/cl_term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl_term.c,v 1.17 2014/11/06 10:48:52 bentley Exp $ */ +/* $OpenBSD: cl_term.c,v 1.18 2014/11/12 04:28:41 bentley Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -79,8 +79,7 @@ static TKLIST const m2_tklist[] = { /* Input mappings (set or delete). */ * PUBLIC: int cl_term_init(SCR *); */ int -cl_term_init(sp) - SCR *sp; +cl_term_init(SCR *sp) { KEYLIST *kp; SEQ *qp; @@ -154,8 +153,7 @@ cl_term_init(sp) * PUBLIC: int cl_term_end(GS *); */ int -cl_term_end(gp) - GS *gp; +cl_term_end(GS *gp) { SEQ *qp, *nqp; @@ -175,11 +173,8 @@ cl_term_end(gp) * PUBLIC: int cl_fmap(SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t); */ int -cl_fmap(sp, stype, from, flen, to, tlen) - SCR *sp; - seq_t stype; - CHAR_T *from, *to; - size_t flen, tlen; +cl_fmap(SCR *sp, seq_t stype, CHAR_T *from, size_t flen, CHAR_T *to, + size_t tlen) { /* Ignore until the screen is running, do the real work then. */ if (F_ISSET(sp, SC_VI) && !F_ISSET(sp, SC_SCR_VI)) @@ -195,11 +190,8 @@ cl_fmap(sp, stype, from, flen, to, tlen) * Map a function key (private version). */ static int -cl_pfmap(sp, stype, from, flen, to, tlen) - SCR *sp; - seq_t stype; - CHAR_T *from, *to; - size_t flen, tlen; +cl_pfmap(SCR *sp, seq_t stype, CHAR_T *from, size_t flen, CHAR_T *to, + size_t tlen) { size_t nlen; char *p, key_name[64]; @@ -228,11 +220,7 @@ cl_pfmap(sp, stype, from, flen, to, tlen) * PUBLIC: int cl_optchange(SCR *, int, char *, u_long *); */ int -cl_optchange(sp, opt, str, valp) - SCR *sp; - int opt; - char *str; - u_long *valp; +cl_optchange(SCR *sp, int opt, char *str, u_long *valp) { CL_PRIVATE *clp; @@ -279,10 +267,7 @@ cl_optchange(sp, opt, str, valp) * PUBLIC: int cl_omesg(SCR *, CL_PRIVATE *, int); */ int -cl_omesg(sp, clp, on) - SCR *sp; - CL_PRIVATE *clp; - int on; +cl_omesg(SCR *sp, CL_PRIVATE *clp, int on) { struct stat sb; char *tty; @@ -328,11 +313,7 @@ cl_omesg(sp, clp, on) * PUBLIC: int cl_ssize(SCR *, int, size_t *, size_t *, int *); */ int -cl_ssize(sp, sigwinch, rowp, colp, changedp) - SCR *sp; - int sigwinch; - size_t *rowp, *colp; - int *changedp; +cl_ssize(SCR *sp, int sigwinch, size_t *rowp, size_t *colp, int *changedp) { #ifdef TIOCGWINSZ struct winsize win; @@ -454,8 +435,7 @@ noterm: if (row == 0) * PUBLIC: int cl_putchar(int); */ int -cl_putchar(ch) - int ch; +cl_putchar(int ch) { return (putchar(ch)); } |