version 1.32, 2012/06/09 14:11:15 |
version 1.34, 2013/07/05 09:33:02 |
|
|
|
|
#include <assert.h> |
#include <assert.h> |
#include <getopt.h> |
#include <getopt.h> |
|
#include <stdint.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
Line 36 main(int argc, char *argv[]) |
|
Line 37 main(int argc, char *argv[]) |
|
struct mansearch search; |
struct mansearch search; |
size_t i, sz; |
size_t i, sz; |
struct manpage *res; |
struct manpage *res; |
char *conf_file, *defpaths, *auxpaths; |
|
struct manpaths paths; |
struct manpaths paths; |
|
char *defpaths, *auxpaths; |
|
char *conf_file; |
char *progname; |
char *progname; |
extern char *optarg; |
extern char *optarg; |
extern int optind; |
extern int optind; |
Line 48 main(int argc, char *argv[]) |
|
Line 50 main(int argc, char *argv[]) |
|
else |
else |
++progname; |
++progname; |
|
|
auxpaths = defpaths = conf_file = NULL; |
whatis = (0 == strncmp(progname, "whatis", 6)); |
|
|
memset(&paths, 0, sizeof(struct manpaths)); |
memset(&paths, 0, sizeof(struct manpaths)); |
memset(&search, 0, sizeof(struct mansearch)); |
memset(&search, 0, sizeof(struct mansearch)); |
whatis = (0 == strcmp(progname, "whatis")); |
|
|
|
|
auxpaths = defpaths = NULL; |
|
conf_file = NULL; |
|
|
while (-1 != (ch = getopt(argc, argv, "C:M:m:S:s:"))) |
while (-1 != (ch = getopt(argc, argv, "C:M:m:S:s:"))) |
switch (ch) { |
switch (ch) { |
case ('C'): |
case ('C'): |
Line 98 main(int argc, char *argv[]) |
|
Line 103 main(int argc, char *argv[]) |
|
free(res); |
free(res); |
return(sz ? EXIT_SUCCESS : EXIT_FAILURE); |
return(sz ? EXIT_SUCCESS : EXIT_FAILURE); |
usage: |
usage: |
fprintf(stderr, "usage: %s [-C conf] " |
fprintf(stderr, "usage: %s [-C file] [-M path] [-m path] " |
"[-M paths] " |
"[-S arch] [-s section]%s ...\n", progname, |
"[-m paths] " |
whatis ? " name" : "\n expression"); |
"[-S arch] " |
|
"[-s section] " |
|
"expr ...\n", |
|
progname); |
|
return(EXIT_FAILURE); |
return(EXIT_FAILURE); |
} |
} |