2 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
6 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
7 /* All Rights Reserved */
10 * Copyright (c) 1980 Regents of the University of California.
11 * All rights reserved. The Berkeley software License Agreement
12 * specifies the terms and conditions for redistribution.
15 #pragma ident "%Z%%M% %I% %E% SMI"
20 extern char *comname
; /* "/usr/lib/refer/eign" */
26 char *iglist
= "XYZ#";
30 extern char *trimnl();
33 main(int argc
, char *argv
[])
36 * this program expects as its arguments a list of
37 * files and generates a set of lines of the form
38 * filename:byte-add,length (tab) key1 key2 key3
39 * where the byte addresses give the position within
40 * the file and the keys are the strings off the lines
41 * which are alphabetic, first six characters only.
50 (void) setlocale(LC_ALL
, "");
52 #if !defined(TEXT_DOMAIN)
53 #define TEXT_DOMAIN "SYS_TEST"
55 (void) textdomain(TEXT_DOMAIN
);
57 while (argc
> 1 && argv
[1][0] == '-') {
78 minlen
= atoi(argv
[1]+2);
79 if (minlen
<= 0) minlen
= 3;
81 case 'n': /* number of common words to use */
82 comcount
= atoi(argv
[1]+2);
84 case 'k': /* number of keys per file max */
85 keycount
= atoi(argv
[1]+2);
87 case 's': /* suppress labels, search only */
95 ff
= fopen(inlist
, "r");
96 while (fgets(qn
, 200, ff
)) {
102 fprintf(stderr
, gettext("Can't read %s\n"), qn
);
108 for (i
= 1; i
< argc
; i
++) {
109 f
= fopen(name
= argv
[i
], "r");
111 err(gettext("No file %s"), name
);