- if (best_indxp)
- { /* there was a hole big enough for a sub entry */
- char *info = (char*) p + *best_indxp;
- short *indxp1;
-
- *--indxp = - *best_indxp;
- DICT_type(p) = 1;
- DICT_nodir (p) -= (best_no-1);
- indxp1 = (short*)((char*)p+DICT_PAGESIZE-DICT_nodir(p)*sizeof(short));
- while (indxp != indxp1)
- {
- --indxp;
- *indxp = indxp[1-best_no];
- }
- memcpy (info, &subptr, sizeof(Dict_ptr)); /* store subptr */
- info += sizeof(Dict_ptr);
- memcpy (info, &best_char, sizeof(Dict_char)); /* store sub char */
- info += sizeof(Dict_char);
- if (info_here)
- memcpy (info, info_here, *info_here+1); /* with information */
- else
- *info = 0; /* without info */
- }
- else
- {
- short *indxp1, *indxp2;
- assert (0);
- DICT_type(p) = 1;
- DICT_nodir(p) -= best_no;
- indxp2 = indxp;
- indxp1 = (short*)((char*) p+DICT_PAGESIZE-DICT_nodir(p)*sizeof(short));
- do
- {
- --indxp2;
- indxp2[0] = indxp2[-best_no];
- } while (indxp2 != indxp1);
- }
+ /* now clean the page ... */
+ clean_page (dict, ptr, p, &best_char, subptr, info_here);