2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.5 1995-09-04 09:09:15 adam
8 * String arg in lookup is const.
10 * Revision 1.4 1994/10/05 12:16:51 adam
11 * Pagesize is a resource now.
13 * Revision 1.3 1994/09/26 10:17:25 adam
16 * Revision 1.2 1994/09/16 15:39:14 adam
17 * Initial code of lookup - not tested yet.
19 * Revision 1.1 1994/08/16 16:26:48 adam
31 static char *dict_look (Dict dict, const Dict_char *str)
40 dict_bf_readp (dict->dbf, ptr, &p);
43 indxp = (short*) ((char*) p+DICT_pagesize(dict)-sizeof(short));
49 /* string (Dict_char *) DICT_EOS terminated */
50 /* unsigned char length of information */
51 /* char * information */
52 info = (char*)p + indxp[-mid];
53 cmp = dict_strcmp((Dict_char*) info, str);
55 return info+(dict_strlen (info)+1)*sizeof(Dict_char);
63 /* Dict_char sub char */
64 /* unsigned char length of information */
65 /* char * information */
66 info = (char*)p - indxp[-mid];
67 memcpy (&dc, info+sizeof(Dict_ptr), sizeof(Dict_char));
71 memcpy (&subptr, info, sizeof(Dict_ptr));
72 if (*++str == DICT_EOS)
74 if (info[sizeof(Dict_ptr)+sizeof(Dict_char)])
75 return info+sizeof(Dict_ptr)+sizeof(Dict_char);
83 dict_bf_readp (dict->dbf, ptr, &p);
86 indxp = (short*) ((char*) p+DICT_pagesize(dict)
100 char *dict_lookup (Dict dict, const Dict_char *p)
102 if (dict->head.last == 1)
104 return dict_look (dict, p);