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,11 +516,29 @@ 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));
dbr = pp->First; if (pp->KindOfPE & LogUpdDBBit) {
/* While we have something in the data base, restore it */ dbr = pp->First;
while (dbr) { /* While we have something in the data base, restore it */
RestoreDBEntry(dbr); while (dbr) {
dbr = dbr->Next; RestoreDBEntry(dbr);
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;
}
} }
} }