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"
22 char *filenam
= "/usr/share/lib/dict/words";
32 int compare(char *, char *);
33 void canon(char *, char *);
37 main(int argc
, char **argv
)
43 while(argc
>=2 && *argv
[1]=='-') {
74 dfile
= fopen(filenam
,"r");
76 fprintf(stderr
,"look: can't open %s\n",filenam
);
79 wstring
= strdup(argv
[1]);
81 if ((ptr
= strchr(wstring
, tab
)) != NULL
) {
95 } while(c
!=EOF
&& c
!='\n');
99 switch(compare(key
,word
)) {
115 while(ftell(dfile
)<top
) {
119 switch(compare(key
,word
)) {
132 while(getword(entry
)) {
134 switch(compare(key
,word
)) {
146 compare(char *s
, char *t
)
161 int avail
= WORDSIZE
- 1;
178 canon(char *old
, char *new)
181 int avail
= WORDSIZE
- 1;