summaryrefslogtreecommitdiffstats
path: root/contrib/nvi/ex/ex_usage.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/nvi/ex/ex_usage.c')
-rw-r--r--contrib/nvi/ex/ex_usage.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/contrib/nvi/ex/ex_usage.c b/contrib/nvi/ex/ex_usage.c
index cddf7a6..9a20ce1 100644
--- a/contrib/nvi/ex/ex_usage.c
+++ b/contrib/nvi/ex/ex_usage.c
@@ -10,7 +10,7 @@
#include "config.h"
#ifndef lint
-static const char sccsid[] = "@(#)ex_usage.c 10.13 (Berkeley) 5/3/96";
+static const char sccsid[] = "$Id: ex_usage.c,v 10.16 2011/12/21 19:26:48 zy Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -34,9 +34,7 @@ static const char sccsid[] = "@(#)ex_usage.c 10.13 (Berkeley) 5/3/96";
* PUBLIC: int ex_help __P((SCR *, EXCMD *));
*/
int
-ex_help(sp, cmdp)
- SCR *sp;
- EXCMD *cmdp;
+ex_help(SCR *sp, EXCMD *cmdp)
{
(void)ex_puts(sp,
"To see the list of vi commands, enter \":viusage<CR>\"\n");
@@ -57,30 +55,28 @@ ex_help(sp, cmdp)
* PUBLIC: int ex_usage __P((SCR *, EXCMD *));
*/
int
-ex_usage(sp, cmdp)
- SCR *sp;
- EXCMD *cmdp;
+ex_usage(SCR *sp, EXCMD *cmdp)
{
ARGS *ap;
EXCMDLIST const *cp;
int newscreen;
- char *name, *p, nb[MAXCMDNAMELEN + 5];
+ CHAR_T *name, *p, nb[MAXCMDNAMELEN + 5];
switch (cmdp->argc) {
case 1:
ap = cmdp->argv[0];
- if (isupper(ap->bp[0])) {
+ if (ISUPPER(ap->bp[0])) {
newscreen = 1;
- ap->bp[0] = tolower(ap->bp[0]);
+ ap->bp[0] = TOLOWER(ap->bp[0]);
} else
newscreen = 0;
for (cp = cmds; cp->name != NULL &&
- memcmp(ap->bp, cp->name, ap->len); ++cp);
+ MEMCMP(ap->bp, cp->name, ap->len); ++cp);
if (cp->name == NULL ||
- newscreen && !F_ISSET(cp, E_NEWSCREEN)) {
+ (newscreen && !F_ISSET(cp, E_NEWSCREEN))) {
if (newscreen)
- ap->bp[0] = toupper(ap->bp[0]);
- (void)ex_printf(sp, "The %.*s command is unknown\n",
+ ap->bp[0] = TOUPPER(ap->bp[0]);
+ (void)ex_printf(sp, "The "WVS" command is unknown\n",
(int)ap->len, ap->bp);
} else {
(void)ex_printf(sp,
@@ -112,10 +108,10 @@ ex_usage(sp, cmdp)
* room, they're all short names.
*/
if (cp == &cmds[C_SCROLL])
- name = "^D";
+ name = L("^D");
else if (F_ISSET(cp, E_NEWSCREEN)) {
nb[0] = '[';
- nb[1] = toupper(cp->name[0]);
+ nb[1] = TOUPPER(cp->name[0]);
nb[2] = cp->name[0];
nb[3] = ']';
for (name = cp->name + 1,
@@ -124,7 +120,7 @@ ex_usage(sp, cmdp)
} else
name = cp->name;
(void)ex_printf(sp,
- "%*s: %s\n", MAXCMDNAMELEN, name, cp->help);
+ WVS": %s\n", MAXCMDNAMELEN, name, cp->help);
}
break;
default:
@@ -140,9 +136,7 @@ ex_usage(sp, cmdp)
* PUBLIC: int ex_viusage __P((SCR *, EXCMD *));
*/
int
-ex_viusage(sp, cmdp)
- SCR *sp;
- EXCMD *cmdp;
+ex_viusage(SCR *sp, EXCMD *cmdp)
{
GS *gp;
VIKEYS const *kp;
OpenPOWER on IntegriCloud