sprinkle a few static and clean up the internal APIs

This commit is contained in:
tg 2009-03-15 16:13:40 +00:00
parent 32bc1dc40e
commit 7c040d98f9
4 changed files with 14 additions and 14 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.257 2009/03/14 18:12:50 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.258 2009/03/15 16:13:37 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -7,7 +7,7 @@
# http://www.research.att.com/~gsf/public/ifs.sh
expected-stdout:
@(#)MIRBSD KSH R36 2009/03/14
@(#)MIRBSD KSH R36 2009/03/15
description:
Check version of shell.
stdin:

13
edit.c
View File

@ -5,7 +5,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.152 2009/02/22 19:02:27 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.153 2009/03/15 16:13:38 tg Exp $");
/* tty driver characters we are interested in */
typedef struct {
@ -17,7 +17,7 @@ typedef struct {
int eof;
} X_chars;
X_chars edchars;
static X_chars edchars;
/* x_fc_glob() flags */
#define XCF_COMMAND BIT(0) /* Do command completion */
@ -58,6 +58,7 @@ static int x_command_glob(int, const char *, int, char ***);
static int x_locate_word(const char *, int, int, int *, bool *);
static int x_e_getmbc(char *);
static int utf_wcwidth(unsigned int);
/* +++ generic editing functions +++ */
@ -775,7 +776,7 @@ utf_skipcols(const char *p, int cols)
__RCSID("$miros: src/lib/libc/i18n/wcwidth.c,v 1.8 2008/09/20 12:01:18 tg Exp $");
int
static int
utf_wcwidth(unsigned int c)
{
static const struct cbset {
@ -2551,8 +2552,8 @@ x_print(int prefix, int key)
int
x_bind(const char *a1, const char *a2,
int macro, /* bind -m */
int list) /* bind -l */
bool macro, /* bind -m */
bool list) /* bind -l */
{
unsigned char f;
int prefix, key;
@ -3430,7 +3431,7 @@ static int x_vi_putbuf(const char *, size_t);
#define is_srch(c) (classify[(c)&0x7f]&S_)
#define is_zerocount(c) (classify[(c)&0x7f]&Z_)
const unsigned char classify[128] = {
static const unsigned char classify[128] = {
/* 0 1 2 3 4 5 6 7 */
/* 0 ^@ ^A ^B ^C ^D ^E ^F ^G */
B_, 0, 0, 0, 0, C_|U_, C_|Z_, 0,

View File

@ -5,7 +5,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.94 2009/03/14 18:12:52 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.95 2009/03/15 16:13:39 tg Exp $");
/* A leading = means assignments before command are kept;
* a leading * means a POSIX special builtin;
@ -1495,7 +1495,7 @@ c_bind(const char **wp)
wp += builtin_opt.optind;
if (*wp == NULL) /* list all */
rv = x_bind((char*)NULL, (char*)NULL, 0, list);
rv = x_bind(NULL, NULL, 0, list);
for (; *wp != NULL; wp++) {
if ((cp = cstrchr(*wp, '=')) == NULL)

7
sh.h
View File

@ -102,9 +102,9 @@
#define __SCCSID(x) __IDSTRING(sccsid,x)
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.275 2009/03/14 18:12:54 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.276 2009/03/15 16:13:40 tg Exp $");
#endif
#define MKSH_VERSION "R36 2009/03/14"
#define MKSH_VERSION "R36 2009/03/15"
#ifndef MKSH_INCLUDES_ONLY
@ -1272,13 +1272,12 @@ void afree(void *, Area *); /* can take NULL */
/* edit.c */
void x_init(void);
int x_read(char *, size_t);
int x_bind(const char *, const char *, int, int);
int x_bind(const char *, const char *, bool, bool);
/* UTF-8 stuff */
size_t utf_mbtowc(unsigned int *, const char *);
size_t utf_wctomb(char *, unsigned int);
int utf_widthadj(const char *, const char **);
int utf_mbswidth(const char *);
int utf_wcwidth(unsigned int);
const char *utf_skipcols(const char *, int);
/* eval.c */
char *substitute(const char *, int);