run GNU protoize

protect header files
nuke some dead code
regenerate configure script
let silly code die
This commit is contained in:
tg
2004-10-28 11:53:44 +00:00
parent dc7da8ddbf
commit b2de14e57c
46 changed files with 1024 additions and 1991 deletions

View File

@ -1,4 +1,4 @@
/** $MirBSD: c_test.c,v 1.6 2004/10/28 11:11:17 tg Exp $ */
/** $MirBSD: c_test.c,v 1.7 2004/10/28 11:53:39 tg Exp $ */
/* $OpenBSD: c_test.c,v 1.10 2003/10/10 19:09:07 millert Exp $ */
/*
@ -14,7 +14,7 @@
#include "ksh_stat.h"
#include "c_test.h"
__RCSID("$MirBSD: c_test.c,v 1.6 2004/10/28 11:11:17 tg Exp $");
__RCSID("$MirBSD: c_test.c,v 1.7 2004/10/28 11:53:39 tg Exp $");
/* test(1) accepts the following grammar:
oexpr ::= aexpr | aexpr "-o" oexpr ;
@ -103,8 +103,7 @@ static int ptest_eval(Test_env *te, Test_op op, const char *opnd1,
static void ptest_error(Test_env *te, int offset, const char *msg);
int
c_test(wp)
char **wp;
c_test(char **wp)
{
int argc;
int res;
@ -188,10 +187,7 @@ c_test(wp)
*/
Test_op
test_isop(te, meta, s)
Test_env *te;
Test_meta meta;
const char *s;
test_isop(Test_env *te, Test_meta meta, const char *s)
{
char sc1;
const struct t_op *otab;
@ -211,12 +207,7 @@ test_isop(te, meta, s)
}
int
test_eval(te, op, opnd1, opnd2, do_eval)
Test_env *te;
Test_op op;
const char *opnd1;
const char *opnd2;
int do_eval;
test_eval(Test_env *te, Test_op op, const char *opnd1, const char *opnd2, int do_eval)
{
int res;
int not;
@ -421,9 +412,7 @@ test_eval(te, op, opnd1, opnd2, do_eval)
/* Nasty kludge to handle Korn's bizarre /dev/fd hack */
static int
test_stat(path, statb)
const char *path;
struct stat *statb;
test_stat(const char *path, struct stat *statb)
{
#if !defined(HAVE_DEV_FD)
int fd;
@ -439,9 +428,7 @@ test_stat(path, statb)
* non-directories when running as root.
*/
static int
test_eaccess(path, mode)
const char *path;
int mode;
test_eaccess(const char *path, int mode)
{
int res;
@ -482,8 +469,7 @@ test_eaccess(path, mode)
}
int
test_parse(te)
Test_env *te;
test_parse(Test_env *te)
{
int res;
@ -496,9 +482,7 @@ test_parse(te)
}
static int
test_oexpr(te, do_eval)
Test_env *te;
int do_eval;
test_oexpr(Test_env *te, int do_eval)
{
int res;
@ -511,9 +495,7 @@ test_oexpr(te, do_eval)
}
static int
test_aexpr(te, do_eval)
Test_env *te;
int do_eval;
test_aexpr(Test_env *te, int do_eval)
{
int res;
@ -526,9 +508,7 @@ test_aexpr(te, do_eval)
}
static int
test_nexpr(te, do_eval)
Test_env *te;
int do_eval;
test_nexpr(Test_env *te, int do_eval)
{
if (!(te->flags & TEF_ERROR) && (*te->isa)(te, TM_NOT))
return !test_nexpr(te, do_eval);
@ -536,9 +516,7 @@ test_nexpr(te, do_eval)
}
static int
test_primary(te, do_eval)
Test_env *te;
int do_eval;
test_primary(Test_env *te, int do_eval)
{
const char *opnd1, *opnd2;
int res;
@ -597,9 +575,7 @@ test_primary(te, do_eval)
* TM_UNOP and TM_BINOP, the returned value is a Test_op).
*/
static int
ptest_isa(te, meta)
Test_env *te;
Test_meta meta;
ptest_isa(Test_env *te, Test_meta meta)
{
/* Order important - indexed by Test_meta values */
static const char *const tokens[] = {
@ -633,21 +609,13 @@ ptest_getopnd(Test_env *te, Test_op op, int do_eval GCC_FUNC_ATTR(unused))
}
static int
ptest_eval(te, op, opnd1, opnd2, do_eval)
Test_env *te;
Test_op op;
const char *opnd1;
const char *opnd2;
int do_eval;
ptest_eval(Test_env *te, Test_op op, const char *opnd1, const char *opnd2, int do_eval)
{
return test_eval(te, op, opnd1, opnd2, do_eval);
}
static void
ptest_error(te, offset, msg)
Test_env *te;
int offset;
const char *msg;
ptest_error(Test_env *te, int offset, const char *msg)
{
const char *op = te->pos.wp + offset >= te->wp_end ?
(const char *) 0 : te->pos.wp[offset];