2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.2 1994-09-16 15:39:14 adam
8 * Initial code of lookup - not tested yet.
10 * Revision 1.1 1994/08/16 16:26:48 adam
22 static char *dict_look (Dict dict, Dict_char *str)
31 dict_bf_readp (dict->dbf, ptr, &p);
34 indxp = (short*) ((char*) p+DICT_PAGESIZE-sizeof(short));
40 /* string (Dict_char *) DICT_EOS terminated */
41 /* unsigned char length of information */
42 /* char * information */
43 info = (char*)p + indxp[-mid];
44 cmp = dict_strcmp((Dict_char*) info, str);
46 return info+(dict_strlen (info)+1)*sizeof(Dict_char);
54 /* Dict_char sub char */
55 /* unsigned char length of information */
56 /* char * information */
57 info = (char*)p - indxp[-mid];
58 memcpy (&dc, info+sizeof(Dict_ptr), sizeof(Dict_char));
62 memcpy (&subptr, info, sizeof(Dict_ptr));
63 if (*++str == DICT_EOS)
64 return info+sizeof(Dict_ptr)+sizeof(Dict_char);
70 dict_bf_readp (dict->dbf, ptr, &p);
73 indxp = (short*) ((char*) p+DICT_PAGESIZE-sizeof(short));
86 char *dict_lookup (Dict dict, Dict_char *p)
88 if (dict->head.last == 1)
90 return dict_look (dict, p);