2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.4 1994-10-05 12:16:51 adam
8 * Pagesize is a resource now.
10 * Revision 1.3 1994/09/26 10:17:25 adam
13 * Revision 1.2 1994/09/16 15:39:14 adam
14 * Initial code of lookup - not tested yet.
16 * Revision 1.1 1994/08/16 16:26:48 adam
28 static char *dict_look (Dict dict, Dict_char *str)
37 dict_bf_readp (dict->dbf, ptr, &p);
40 indxp = (short*) ((char*) p+DICT_pagesize(dict)-sizeof(short));
46 /* string (Dict_char *) DICT_EOS terminated */
47 /* unsigned char length of information */
48 /* char * information */
49 info = (char*)p + indxp[-mid];
50 cmp = dict_strcmp((Dict_char*) info, str);
52 return info+(dict_strlen (info)+1)*sizeof(Dict_char);
60 /* Dict_char sub char */
61 /* unsigned char length of information */
62 /* char * information */
63 info = (char*)p - indxp[-mid];
64 memcpy (&dc, info+sizeof(Dict_ptr), sizeof(Dict_char));
68 memcpy (&subptr, info, sizeof(Dict_ptr));
69 if (*++str == DICT_EOS)
71 if (info[sizeof(Dict_ptr)+sizeof(Dict_char)])
72 return info+sizeof(Dict_ptr)+sizeof(Dict_char);
80 dict_bf_readp (dict->dbf, ptr, &p);
83 indxp = (short*) ((char*) p+DICT_pagesize(dict)
97 char *dict_lookup (Dict dict, Dict_char *p)
99 if (dict->head.last == 1)
101 return dict_look (dict, p);