version 1.8, 2002/02/16 21:27:43 |
version 1.11, 2005/10/17 19:04:19 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* documentation and/or other materials provided with the distribution. |
* 3. All advertising materials mentioning features or use of this software |
* 3. Neither the name of the University nor the names of its contributors |
* must display the following acknowledgement: |
|
* This product includes software developed by the University of |
|
* California, Berkeley and its contributors. |
|
* 4. Neither the name of the University nor the names of its contributors |
|
* may be used to endorse or promote products derived from this software |
* may be used to endorse or promote products derived from this software |
* without specific prior written permission. |
* without specific prior written permission. |
* |
* |
|
|
void usage(void); |
void usage(void); |
|
|
int |
int |
main(argc, argv) |
main(int argc, char *argv[]) |
int argc; |
|
char *argv[]; |
|
{ |
{ |
ENTRY *ep; |
ENTRY *ep; |
TAG *tp; |
TAG *tp; |
|
|
else { |
else { |
config(conffile); |
config(conffile); |
ep = (tp = getlist("_whatdb")) == NULL ? |
ep = (tp = getlist("_whatdb")) == NULL ? |
NULL : tp->list.tqh_first; |
NULL : TAILQ_FIRST(&tp->list); |
for (; ep != NULL; ep = ep->q.tqe_next) |
for (; ep != NULL; ep = TAILQ_NEXT(ep, q)) |
apropos(argv, ep->s, 0); |
apropos(argv, ep->s, 0); |
} |
} |
|
|
|
|
} |
} |
|
|
void |
void |
apropos(argv, path, buildpath) |
apropos(char **argv, char *path, int buildpath) |
char **argv, *path; |
|
int buildpath; |
|
{ |
{ |
char *end, *name, **p; |
char *end, *name, **p; |
char buf[MAXLINELEN + 1], wbuf[MAXLINELEN + 1]; |
char buf[MAXLINELEN + 1], wbuf[MAXLINELEN + 1]; |
|
|
* match anywhere the string appears |
* match anywhere the string appears |
*/ |
*/ |
int |
int |
match(bp, str) |
match(char *bp, char *str) |
char *bp, *str; |
|
{ |
{ |
int len; |
int len; |
char test; |
char test; |
|
|
* convert a string to lower case |
* convert a string to lower case |
*/ |
*/ |
void |
void |
lowstr(from, to) |
lowstr(char *from, char *to) |
char *from, *to; |
|
{ |
{ |
char ch; |
char ch; |
|
|
|
|
* print usage message and die |
* print usage message and die |
*/ |
*/ |
void |
void |
usage() |
usage(void) |
{ |
{ |
|
|
(void)fprintf(stderr, |
(void)fprintf(stderr, |