test.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1986 AT&T
* All Rights Reserved
*/
#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.3 */
#include "test.h"
#include <stdio.h>
#include "wish.h"
typedef struct io_struct {
int flags;
union {
struct {
char *val;
int count;
int pos;
} str;
} mu;
} IOSTRUCT;
char **av;
char *com[];
int argn;
{
ap = 1;
{
}
if (ac <= 1)
return(FAIL);
}
/*
* CF is a "strcmp" function referenced in test.h ....
*/
{
if (*s2++ == 0)
return(0);
}
char *
{
{
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;
long atol();
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, "-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 */
}
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);
return(1);
else
return(0);
}
fsizep(f)
char *f;
{
return(0);
}