2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.3 1994-09-26 10:17:25 adam
10 * Revision 1.2 1994/09/16 15:39:14 adam
11 * Initial code of lookup - not tested yet.
13 * Revision 1.1 1994/08/16 16:26:48 adam
25 static char *dict_look (Dict dict, Dict_char *str)
34 dict_bf_readp (dict->dbf, ptr, &p);
37 indxp = (short*) ((char*) p+DICT_PAGESIZE-sizeof(short));
43 /* string (Dict_char *) DICT_EOS terminated */
44 /* unsigned char length of information */
45 /* char * information */
46 info = (char*)p + indxp[-mid];
47 cmp = dict_strcmp((Dict_char*) info, str);
49 return info+(dict_strlen (info)+1)*sizeof(Dict_char);
57 /* Dict_char sub char */
58 /* unsigned char length of information */
59 /* char * information */
60 info = (char*)p - indxp[-mid];
61 memcpy (&dc, info+sizeof(Dict_ptr), sizeof(Dict_char));
65 memcpy (&subptr, info, sizeof(Dict_ptr));
66 if (*++str == DICT_EOS)
68 if (info[sizeof(Dict_ptr)+sizeof(Dict_char)])
69 return info+sizeof(Dict_ptr)+sizeof(Dict_char);
77 dict_bf_readp (dict->dbf, ptr, &p);
80 indxp = (short*) ((char*) p+DICT_PAGESIZE-sizeof(short));
93 char *dict_lookup (Dict dict, Dict_char *p)
95 if (dict->head.last == 1)
97 return dict_look (dict, p);