support new version of database in save/restore.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@773 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2003-02-14 10:51:29 +00:00
parent 9cde858f11
commit 5f92a9550e

View File

@ -516,12 +516,30 @@ RestoreDB(DBEntry *pp)
pp->FunctorOfDB = FuncAdjust(pp->FunctorOfDB); pp->FunctorOfDB = FuncAdjust(pp->FunctorOfDB);
else else
pp->FunctorOfDB = (Functor) AtomAdjust((Atom)(pp->FunctorOfDB)); pp->FunctorOfDB = (Functor) AtomAdjust((Atom)(pp->FunctorOfDB));
if (pp->KindOfPE & LogUpdDBBit) {
dbr = pp->First; dbr = pp->First;
/* While we have something in the data base, restore it */ /* While we have something in the data base, restore it */
while (dbr) { while (dbr) {
RestoreDBEntry(dbr); RestoreDBEntry(dbr);
dbr = dbr->Next; dbr = dbr->Next;
} }
} else {
if (pp->F0 != NULL)
pp->F0 = DBRefAdjust(pp->F0);
if (pp->L0 != NULL)
pp->L0 = DBRefAdjust(pp->L0);
/* immediate update semantics */
dbr = pp->F0;
/* While we have something in the data base, even if erased, restore it */
while (dbr) {
RestoreDBEntry(dbr);
if (dbr->n != NULL)
dbr->n = DBRefAdjust(dbr->n);
if (dbr->p != NULL)
dbr->p = DBRefAdjust(dbr->p);
dbr = dbr->n;
}
}
} }
/* Restores a DB structure, as it was saved in the heap */ /* Restores a DB structure, as it was saved in the heap */