/*
* 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>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
static int exp(void);
static int e1(void);
static int e2(void);
static int e3(void);
static int tio(char *a, int f);
static int fsizep(char *f);
static int ap;
static int ac;
static char **av;
int
{
int status;
}
if (ac <= 1)
exit(1);
if (nxtarg(1) != 0)
return (status);
}
static char *
{
if (mt) {
ap++;
return (0);
}
}
}
static int
exp(void)
{
int p1;
char *p2;
if (p2 != 0) {
}
ap--;
return (p1);
}
static int
e1(void)
{
int p1;
char *p2;
ap--;
return (p1);
}
static int
e2(void)
{
return (!e3());
ap--;
return (e3());
}
static 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);
}
static int
tio(char *a, int f)
{
if (access(a, f) == 0)
return (1);
else
return (0);
}
static int
{
return (0);
return (1);
return (0);
}
static int
{
return (0);
} else {
return (0);
}
return (1);
else
return (0);
}
static int
fsizep(char *f)
{
return (0);
}
static void
{
exit(255);
}