test.c revision 965005c81e0f731867d47892b9fb677030b102df
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* test expression
* [ expression ]
*/
#include "defs.h"
extern int lstat();
void bfailed(unsigned char *, unsigned char *, unsigned char *) __NORETURN;
unsigned char **av;
int
{
ap = 1;
{
}
if (ac <= 1)
return(1);
return(exp() ? 0 : 1);
}
unsigned char *
{
{
if (mt)
{
ap++;
return(0);
}
}
}
int
exp(void)
{
int p1;
unsigned char *p2;
if (p2 != 0)
{
/* if (!eq(p2, ")"))
failed((unsigned char *)"test", synmsg); */
}
ap--;
return(p1);
}
int
e1(void)
{
int p1;
unsigned char *p2;
ap--;
return(p1);
}
int
e2(void)
{
return(!e3());
ap--;
return(e3());
}
int
e3(void)
{
int p1;
unsigned char *a;
unsigned 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 (ucb_builtins) {
}
else
if (eq(a, "-u"))
if (eq(a, "-g"))
if (eq(a, "-k"))
if (eq(a, "-p"))
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 */
}
int
{
return(0);
return(1);
return(0);
}
int
{
return(0);
return(1);
else
return(0);
}
int
fsizep(unsigned char *f)
{
return(0);
}
/*
* fake diagnostics to continue to look like original
* test(1) diagnostics
*/
void
{
prp();
if (s2)
{
}
newline();
}