run GNU protoize
protect header files nuke some dead code regenerate configure script let silly code die
This commit is contained in:
83
syn.c
83
syn.c
@ -1,4 +1,4 @@
|
||||
/** $MirBSD: syn.c,v 1.6 2004/10/28 11:11:19 tg Exp $ */
|
||||
/** $MirBSD: syn.c,v 1.7 2004/10/28 11:53:43 tg Exp $ */
|
||||
/* $OpenBSD: syn.c,v 1.14 2003/10/22 07:40:38 jmc Exp $ */
|
||||
|
||||
/*
|
||||
@ -8,7 +8,7 @@
|
||||
#include "sh.h"
|
||||
#include "c_test.h"
|
||||
|
||||
__RCSID("$MirBSD: syn.c,v 1.6 2004/10/28 11:11:19 tg Exp $");
|
||||
__RCSID("$MirBSD: syn.c,v 1.7 2004/10/28 11:53:43 tg Exp $");
|
||||
|
||||
struct nesting_state {
|
||||
int start_token; /* token than began nesting (eg, FOR) */
|
||||
@ -63,7 +63,7 @@ static int symbol; /* yylex value */
|
||||
((reject) ? (symbol) : (REJECT, symbol = yylex(cf)))
|
||||
|
||||
static void
|
||||
yyparse()
|
||||
yyparse(void)
|
||||
{
|
||||
int c;
|
||||
|
||||
@ -78,8 +78,7 @@ yyparse()
|
||||
}
|
||||
|
||||
static struct op *
|
||||
pipeline(cf)
|
||||
int cf;
|
||||
pipeline(int cf)
|
||||
{
|
||||
struct op *t, *p, *tl = NULL;
|
||||
|
||||
@ -99,7 +98,7 @@ pipeline(cf)
|
||||
}
|
||||
|
||||
static struct op *
|
||||
andor()
|
||||
andor(void)
|
||||
{
|
||||
struct op *t, *p;
|
||||
int c;
|
||||
@ -117,8 +116,7 @@ andor()
|
||||
}
|
||||
|
||||
static struct op *
|
||||
c_list(multi)
|
||||
int multi;
|
||||
c_list(int multi)
|
||||
{
|
||||
struct op *t = NULL, *p, *tl = NULL;
|
||||
int c;
|
||||
@ -155,8 +153,7 @@ c_list(multi)
|
||||
}
|
||||
|
||||
static struct ioword *
|
||||
synio(cf)
|
||||
int cf;
|
||||
synio(int cf)
|
||||
{
|
||||
struct ioword *iop;
|
||||
int ishere;
|
||||
@ -180,16 +177,14 @@ synio(cf)
|
||||
}
|
||||
|
||||
static void
|
||||
musthave(c, cf)
|
||||
int c, cf;
|
||||
musthave(int c, int cf)
|
||||
{
|
||||
if ((token(cf)) != c)
|
||||
syntaxerr((char *) 0);
|
||||
}
|
||||
|
||||
static struct op *
|
||||
nested(type, smark, emark)
|
||||
int type, smark, emark;
|
||||
nested(int type, int smark, int emark)
|
||||
{
|
||||
struct op *t;
|
||||
struct nesting_state old_nesting;
|
||||
@ -202,8 +197,7 @@ nested(type, smark, emark)
|
||||
}
|
||||
|
||||
static struct op *
|
||||
get_command(cf)
|
||||
int cf;
|
||||
get_command(int cf)
|
||||
{
|
||||
struct op *t;
|
||||
int c, iopn = 0, syniocf;
|
||||
@ -419,7 +413,7 @@ get_command(cf)
|
||||
}
|
||||
|
||||
static struct op *
|
||||
dogroup()
|
||||
dogroup(void)
|
||||
{
|
||||
int c;
|
||||
struct op *list;
|
||||
@ -442,7 +436,7 @@ dogroup()
|
||||
}
|
||||
|
||||
static struct op *
|
||||
thenpart()
|
||||
thenpart(void)
|
||||
{
|
||||
struct op *t;
|
||||
|
||||
@ -456,7 +450,7 @@ thenpart()
|
||||
}
|
||||
|
||||
static struct op *
|
||||
elsepart()
|
||||
elsepart(void)
|
||||
{
|
||||
struct op *t;
|
||||
|
||||
@ -479,7 +473,7 @@ elsepart()
|
||||
}
|
||||
|
||||
static struct op *
|
||||
caselist()
|
||||
caselist(void)
|
||||
{
|
||||
struct op *t, *tl;
|
||||
int c;
|
||||
@ -505,8 +499,7 @@ caselist()
|
||||
}
|
||||
|
||||
static struct op *
|
||||
casepart(endtok)
|
||||
int endtok;
|
||||
casepart(int endtok)
|
||||
{
|
||||
struct op *t;
|
||||
int c;
|
||||
@ -534,9 +527,9 @@ casepart(endtok)
|
||||
}
|
||||
|
||||
static struct op *
|
||||
function_body(name, ksh_func)
|
||||
char *name;
|
||||
int ksh_func; /* function foo { ... } vs foo() { .. } */
|
||||
function_body(char *name, int ksh_func)
|
||||
|
||||
/* function foo { ... } vs foo() { .. } */
|
||||
{
|
||||
char *sname, *p;
|
||||
struct op *t;
|
||||
@ -595,7 +588,7 @@ function_body(name, ksh_func)
|
||||
}
|
||||
|
||||
static char **
|
||||
wordlist()
|
||||
wordlist(void)
|
||||
{
|
||||
int c;
|
||||
XPtrV args;
|
||||
@ -625,10 +618,7 @@ wordlist()
|
||||
*/
|
||||
|
||||
static struct op *
|
||||
block(type, t1, t2, wp)
|
||||
int type;
|
||||
struct op *t1, *t2;
|
||||
char **wp;
|
||||
block(int type, struct op *t1, struct op *t2, char **wp)
|
||||
{
|
||||
struct op *t;
|
||||
|
||||
@ -683,7 +673,7 @@ const struct tokeninfo {
|
||||
};
|
||||
|
||||
void
|
||||
initkeywords()
|
||||
initkeywords(void)
|
||||
{
|
||||
struct tokeninfo const *tt;
|
||||
struct tbl *p;
|
||||
@ -700,8 +690,7 @@ initkeywords()
|
||||
}
|
||||
|
||||
static void
|
||||
syntaxerr(what)
|
||||
const char *what;
|
||||
syntaxerr(const char *what)
|
||||
{
|
||||
char redir[6]; /* 2<<- is the longest redirection, I think */
|
||||
const char *s;
|
||||
@ -753,9 +742,7 @@ syntaxerr(what)
|
||||
}
|
||||
|
||||
static void
|
||||
nesting_push(save, tok)
|
||||
struct nesting_state *save;
|
||||
int tok;
|
||||
nesting_push(struct nesting_state *save, int tok)
|
||||
{
|
||||
*save = nesting;
|
||||
nesting.start_token = tok;
|
||||
@ -763,15 +750,13 @@ nesting_push(save, tok)
|
||||
}
|
||||
|
||||
static void
|
||||
nesting_pop(saved)
|
||||
struct nesting_state *saved;
|
||||
nesting_pop(struct nesting_state *saved)
|
||||
{
|
||||
nesting = *saved;
|
||||
}
|
||||
|
||||
static struct op *
|
||||
newtp(type)
|
||||
int type;
|
||||
newtp(int type)
|
||||
{
|
||||
struct op *t;
|
||||
|
||||
@ -786,8 +771,7 @@ newtp(type)
|
||||
}
|
||||
|
||||
struct op *
|
||||
compile(s)
|
||||
Source *s;
|
||||
compile(Source *s)
|
||||
{
|
||||
nesting.start_token = 0;
|
||||
nesting.start_line = 0;
|
||||
@ -808,8 +792,7 @@ compile(s)
|
||||
* $
|
||||
*/
|
||||
static int
|
||||
assign_command(s)
|
||||
char *s;
|
||||
assign_command(char *s)
|
||||
{
|
||||
char c = *s;
|
||||
|
||||
@ -823,8 +806,7 @@ assign_command(s)
|
||||
|
||||
/* Check if we are in the middle of reading an alias */
|
||||
static int
|
||||
inalias(s)
|
||||
struct source *s;
|
||||
inalias(struct source *s)
|
||||
{
|
||||
for (; s && s->type == SALIAS; s = s->next)
|
||||
if (!(s->flags & SF_ALIASEND))
|
||||
@ -857,9 +839,7 @@ const char db_gthan[] = { CHAR, '>', EOS };
|
||||
* TM_UNOP and TM_BINOP, the returned value is a Test_op).
|
||||
*/
|
||||
static int
|
||||
dbtestp_isa(te, meta)
|
||||
Test_env *te;
|
||||
Test_meta meta;
|
||||
dbtestp_isa(Test_env *te, Test_meta meta)
|
||||
{
|
||||
int c = tpeek(ARRAYVAR | (meta == TM_BINOP ? 0 : CONTIN));
|
||||
int uqword = 0;
|
||||
@ -928,10 +908,7 @@ dbtestp_eval(Test_env *te GCC_FUNC_ATTR(unused),
|
||||
}
|
||||
|
||||
static void
|
||||
dbtestp_error(te, offset, msg)
|
||||
Test_env *te;
|
||||
int offset;
|
||||
const char *msg;
|
||||
dbtestp_error(Test_env *te, int offset, const char *msg)
|
||||
{
|
||||
te->flags |= TEF_ERROR;
|
||||
|
||||
|
Reference in New Issue
Block a user