nistest.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) 1988-1992 Sun Microsystems Inc
* All Rights Reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
*
* nis+ object test utility
*/
#include <stdio.h>
extern int optind;
extern char *optarg;
#define EXIT_TRUE 0
#define EXIT_FALSE 1
#define EXIT_ERROR 2
#define CMP_LT 0
#define CMP_LE 1
#define CMP_EQ 2
#define CMP_HT 3
#define CMP_HE 4
#define CMP_NE 5
#define CMP_NS 6
struct cmp_key {
char *key;
int value;
};
"<", CMP_LT,
"lt", CMP_LT,
"<=", CMP_LE,
"le", CMP_LE,
"=", CMP_EQ,
"eq", CMP_EQ,
">", CMP_HT,
"ht", CMP_HT,
"gt", CMP_HT,
">=", CMP_HE,
"he", CMP_HE,
"ge", CMP_HE,
"!=", CMP_NE,
"ne", CMP_NE,
"ns", CMP_NS,
NULL, 0,
};
void
usage()
{
"usage: nistest [-LPAM] [-t G|D|L|T|E|P] [-a mode] name\n");
" nistest -c [dir op dir]\n");
}
#define TEST_TYPE 1
#define TEST_ACCESS 2
#define TEST_CMP 3
unsigned int flags = 0;
int dotest_called = 0;
static
void
cmp_list()
{
struct cmp_key *p;
printf("Op\tMeaning\n");
printf("----\t-------\n");
switch (p->value) {
case CMP_LT:
printf("lower than");
break;
case CMP_LE:
printf("lower than or equal");
break;
case CMP_EQ:
printf("equal");
break;
case CMP_HT:
printf("higher than");
break;
case CMP_HE:
printf("higher than or equal");
break;
case CMP_NE:
printf("not equal");
break;
case CMP_NS:
printf("not sequential");
break;
}
printf("\n");
}
}
static
int
{
int ret;
struct cmp_key *p;
break;
}
return (EXIT_ERROR);
}
return (EXIT_ERROR);
}
switch (p->value) {
case CMP_LT:
break;
case CMP_LE:
break;
case CMP_EQ:
break;
case CMP_HT:
break;
case CMP_HE:
break;
case CMP_NE:
break;
case CMP_NS:
break;
}
if (ret)
return (EXIT_TRUE);
return (EXIT_FALSE);
}
int
char *tab;
void *udata;
{
if ((flags & TEST_ACCESS) &&
dotest_called = 1;
}
int argc;
char *argv[];
{
int c;
char *name;
switch (c) {
case 'L':
break;
case 'P':
fpath = FOLLOW_PATH;
break;
case 'A':
break;
case 'M':
break;
case 't':
switch (*optarg) {
case 'G':
break;
case 'D':
break;
case 'T':
break;
case 'L':
break;
case 'E':
break;
case 'P':
break;
default:
usage();
break;
}
break;
case 'a':
flags |= TEST_ACCESS;
oaccess = 0;
usage();
break;
case 'c':
"nistest",
"-c can only be specified once");
} else if (flags != 0) {
"nistest",
"-c cannot be combined with other tests");
}
break;
default:
usage();
}
case 0:
cmp_list();
break;
case 3:
break;
default:
usage();
break;
}
}
usage();
/*
* Get the object using expand name magic, and test it.
*/
if (*name == '[') {
} else {
}
if (dotest_called)
}