test.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
/*
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
* All Rights Reserved.
*/
#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */
/*
* test expression
* [ expression ]
*/
#include <stdio.h>
int ap;
int ac;
char **av;
char *nxtarg();
char *argv[];
{
int status;
}
if (nxtarg(1)!=0)
}
if(mt) {
ap++;
return(0);
}
}
}
exp() {
int p1;
char *p2;
if (p2 != 0) {
}
ap--;
return(p1);
}
e1() {
int p1;
char *p2;
ap--;
return(p1);
}
e2() {
return(!e3());
ap--;
return(e3());
}
e3() {
int p1;
register char *a;
char *p2;
a=nxtarg(0);
if(EQ(a, "(")) {
return(p1);
}
ap--;
if(EQ(a, "-r"))
if(EQ(a, "-w"))
if(EQ(a, "-x"))
if(EQ(a, "-d"))
if(EQ(a, "-c"))
if(EQ(a, "-b"))
if(EQ(a, "-f")) {
}
if(EQ(a, "-h"))
if(EQ(a, "-u"))
if(EQ(a, "-g"))
if(EQ(a, "-k"))
if(EQ(a, "-p"))
#ifdef S_IFIFO
#else
return(nxtarg(0), 0);
#endif
if(EQ(a, "-s"))
if(EQ(a, "-t"))
return(isatty(1));
ap--;
return(isatty(1));
} else
if(EQ(a, "-n"))
if(EQ(a, "-z"))
}
if (p2==0)
return(!EQ(a,""));
ap--;
return(!EQ(a,""));
}
/* NOTREACHED */
}
tio(a, f)
char *a;
int f;
{
if (access(a, f) == 0)
return(1);
else
return(0);
}
char *f;
int field;
{
return(0);
return(1);
return(0);
}
char *f;
int field;
{
return(0);
} else {
return(0);
}
return(1);
else
return(0);
}
fsizep(f)
char *f;
{
return(0);
}
{
exit(255);
}
length(s)
char *s;
{
char *es=s;
while(*es++);
return(es-s-1);
}