/*
* Copyright 1990 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* 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"
#include <dirent.h>
#include <stdio.h>
#include <ctype.h>
static char *bindirs[] = {
"/etc",
"/sbin",
"/usr/ucbinclude",
0
};
static char *mandirs[] = {
0
};
static char *srcdirs[] = {
"/usr/src/ucbinclude",
0
};
char **Sflag;
int Scnt;
char **Bflag;
int Bcnt;
char **Mflag;
int Mcnt;
char uflag;
void getlist(int *, char ***, char ***, int *);
void zerof(void);
void lookup(char *);
void looksrc(char *);
void lookbin(char *);
void lookman(char *);
void findv(char **, int, char *);
void find(char **, char *);
void findin(char *, char *);
/*
* whereis name
* look for source, documentation and binaries
*/
int
{
if (argc == 0) {
"name...\n");
exit(1);
}
do
if (argv[0][0] == '-') {
while (*cp) {
switch (*cp++) {
case 'f':
break;
case 'S':
break;
case 'B':
break;
case 'M':
break;
case 's':
zerof();
sflag++;
continue;
case 'u':
uflag++;
continue;
case 'b':
zerof();
bflag++;
continue;
case 'm':
zerof();
mflag++;
continue;
default:
goto usage;
}
}
argv++;
} else
while (--argc > 0);
return (0);
}
void
{
(*argvp)++;
*cntp = 0;
(*argcp)++;
(*argvp)--;
}
void
zerof(void)
{
}
int count;
int print;
void
{
char *dp;
continue;
if (*dp == '.') {
*dp = 0;
break;
}
}
if (*dp == '/')
if (uflag) {
print = 0;
count = 0;
} else
print = 1;
if (print)
if (sflag) {
print = 1;
goto again;
}
}
count = 0;
if (bflag) {
print = 1;
goto again;
}
}
count = 0;
if (mflag) {
print = 1;
goto again;
}
}
if (print)
printf("\n");
}
void
{
if (Sflag == 0) {
} else
}
void
{
if (Bflag == 0)
else
}
void
{
if (Mflag == 0) {
} else
}
void
{
while (dirc > 0)
}
void
{
while (*dirs)
}
void
{
return;
count++;
if (print)
}
}
}
int
{
return (1);
return (1);
dp++;
--i;
while (i > 0 && *dp)
if (--i, *dp++ == '.')
return (1);
}
return (0);
}