test.c revision 88f3d7297a011d0fa0768a7b2082305a822487b2
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* test expression
* [ expression ]
*/
#include <stdio.h>
int ap;
int ac;
char **av;
int tio(char *a, int f);
int fsizep(char *f);
int
{
int status;
}
if (nxtarg(1)!=0)
return (status);
}
char *
{
if(mt) {
ap++;
return(0);
}
}
}
int
exp(void)
{
int p1;
char *p2;
if (p2 != 0) {
}
ap--;
return(p1);
}
int
e1(void)
{
int p1;
char *p2;
ap--;
return(p1);
}
int
e2(void)
{
return(!e3());
ap--;
return(e3());
}
int
e3(void)
{
int p1;
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 */
return (0);
}
int
tio(char *a, int f)
{
if (access(a, f) == 0)
return(1);
else
return(0);
}
int
{
return(0);
return(1);
return(0);
}
int
{
return(0);
} else {
return(0);
}
return(1);
else
return(0);
}
int
fsizep(char *f)
{
return(0);
}
void
{
exit(255);
}
int
length(char *s)
{
char *es=s;
while(*es++);
return(es-s-1);
}